What is AmazonProvidedDNS IP address? - amazon-web-services

from AWS doc, it states that the Amazon DNS Server would be the Base of your VPC network range plus two. I'm confused if this server is also the same AmazonProvidedDNS that you set in your dhcp option sets.
The Amazon DNS server does not reside within a specific subnet or Availability Zone in a VPC. It's located at the address 169.254.169.253 (and the reserved IP address at the base of the VPC IPv4 network range, plus two) and fd00:ec2::253. For example, the Amazon DNS Server on a 10.0.0.0/16 network is located at 10.0.0.2. For VPCs with multiple IPv4 CIDR blocks, the DNS server IP address is located in the primary CIDR block.
Is the "Amazon DNS server" and AmazonProvidedDNS the same?
For example if my VPC's base network range is 10.0.0.0 if I run a DNS query against 10.0.0.2, I'm querying against the AmazonProvidedDNS (aka Amazon DNS Server)?

AmazonProvidedDNS is an option in the default DHCP option set. DHCP option sets are settings for your VPC where you can specify IP addresses for things such as domain name server, NTP server and NetBIOS server.
From the docs linked above:
Domain name servers: The DNS servers that will be used to resolve the IP address of the host. In the default option set, the only value is AmazonProvidedDNS. The string AmazonProvidedDNS maps to Amazon's DNS server.
Essentially this means, if you have the default DHCP options set used for your VPC and you are querying the network address + 2 address (for example: 10.0.0.2), you will be querying the Amazon DNS servers.
If you have time, you could also watch this AWS re:Invent 2019: Deep dive on DNS in the hybrid cloud presentation about how DNS works inside an AWS VPC.

The doc Amazon VPC > DNS Attributes > Amazon DNS Server says
The Amazon DNS server does not reside within a specific subnet or
Availability Zone in a VPC. It's located at the address
169.254.169.253 (and the reserved IP address at the base of the VPC's IPv4 network range, plus two) and fd00:ec2::253.
It's not in this subnet's private IPv4 CIDR (e.g. a /24) unless this subnet happens to be the one allocated at the bottom of the VPC's CIDR (e.g. a /16). To simplify finding the DNS server, or for use before you get an address assignment via DHCP or PD, it's also available at static link-local IPv4 and IPv6 addresses.
Similarly, the Amazon Time Sync Service is available early in the boot process at static link-local addresses, 169.254.169.123 and fd00:ec2::123, but it's different: Why doesn't it have its own symbol AmazonProvidedNTP in the default DHCP option set, analogous to AmazonProvidedDNS? Why don't the DNS and NTP services share the same addresses on the same ENI? And why isn't NTP also available at the VPC's IPv4 base plus 2 (or whatever)? Good questions!

Related

AWS unknown IP address

The IP address 10.20.1.1 came up during our security scan and I was wondering which resource this IP belongs to. I searched through the EC2 instances and wasn't able to find this IP, it looks like a network interface IP or something like this so was wondering if someone could please point me to the right direction so I can find the resource and match it to that IP.
From Subnets for your VPC - Amazon Virtual Private Cloud:
The first four IP addresses and the last IP address in each subnet CIDR block are not available for your use, and they cannot be assigned to a resource, such as an EC2 instance. For example, in a subnet with CIDR block 10.0.0.0/24, the following five IP addresses are reserved:
10.0.0.0: Network address.
10.0.0.1: Reserved by AWS for the VPC router.
10.0.0.2: Reserved by AWS. The IP address of the DNS server is the base of the VPC network range plus two. For VPCs with multiple CIDR blocks, the IP address of the DNS server is located in the primary CIDR. We also reserve the base of each subnet range plus two for all CIDR blocks in the VPC. For more information, see Amazon DNS server.
10.0.0.3: Reserved by AWS for future use.
10.0.0.255: Network broadcast address. We do not support broadcast in a VPC, therefore we reserve this address.
Since you have a subnet of 10.20.1.0/24, the address of 10.20.1.1 is Reserved by AWS for the VPC router.
AWS is responsible for routing traffic within a VPC according to the DHCP option sets in Amazon VPC. When a new instance launches and uses DHCP to obtain an IP address in the subnet, it is provided with the address of the router. Some network settings (such as DNS server) can be set, but AWS retains control of the router.
Your network scan detected the IP address associated with this router.

DNS resolution in aws from EC2

If spinned up an EC2 instance in a vpc, I removed all outbound rules for security group of EC2, when I ping any public domain like google.com, Facebook.Com from server, still its getting the ip address of domain(similarly pinging Google.com {ipaddress} with 32 bytes of data). From where does instance gets ip address of domain and on which port? even though I blocked all outbound rules of security group?
AWS security groups and network ACLs don't filter traffic to or from:
AWS reserved IPv4 addresses (these are the first four IPv4 addresses of the subnet, including the Amazon DNS server address for the VPC)
link-local addresses (169.254.0.0/16)
The Amazon-supplied VPC DNS server is at the VPC subnet CIDR base +2 address (e.g. 10.0.0.2 if your VPC subnet CIDR is 10.0.0.0).
See Internetwork traffic privacy in Amazon VPC.

AWS Route-53 DNS Server IP Address

I'm using Route-53 as a DNS management service.
I have a problem that I'm not really sure how to solve it. I've come here to seek ideas.
I have a partner who wants an IP address of the DNS server, so that they can integrate their on-prem DNS server, to what I'm using(Route-53). This is not possible as Route-53 doesn't give an IP address for accessing the DNS servers. This is because it's a managed service. How can I get IP address for the Route-53 DNS servers so that my integrating partner can use to integrate the DNS server from their end to mine(Route-53)?
I appreciate your advice.
Taken from AWS docs:
10.0.0.2: Reserved by AWS. The IP address of the DNS server is the base of the VPC network range plus two. For VPCs with multiple CIDR blocks, the IP address of the DNS server is located in the primary CIDR. We also reserve the base of each subnet range plus two for all CIDR blocks in the VPC. For more information, see Amazon DNS server.
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html
I'm assuming your hosted zone is private, as if it was public, your partner wouldn't need to do any special configuration (unless they don't allow querying public DNS in their network).
If this is a private DNS, I think what you want is to setup a Route 53 Resolver. Specifically, you would want an inbound endpoint setup in your VPC. This will give you a specific IP address that you can provide to your partner. If you haven't already, you'd then need to configure network routing between your VPC and your partner's network (via a tunnel or peering).
AWS has a couple user guides for this, see below:
Route 53 Resolver Developer Guide
Route 53 Resolver announcement

How to reach a particular IP address from netmask /30 to netmask /28

I'm setting up a new Amazon VPC through the console but it's restricted to between a /16 netmask and /28 netmask.
From the other side, a client expects to get an EC2 instance at their end of the tunnel from an internal network with a netmask of /30.
So then, how can I create a VPC which is capable of hosting EC2 instances on the CIDR block 172.30.228.184/30 ? How should that subnet be configured in order to communicate with the /30 block?
AWS preserve 4 IPs to use for there purpose on each subnet, so you cannot create /30 subnet. See This.
The first four IP addresses and the last IP address in each subnet CIDR block are not available for you to use, and cannot be assigned to an instance. For example, in a subnet with CIDR block 10.0.0.0/24, the following five IP addresses are reserved:
10.0.0.0: Network address.
10.0.0.1: Reserved by AWS for the VPC router.
10.0.0.2: Reserved by AWS. The IP address of the DNS server is always the base of the VPC network range plus two; however, we also reserve the base of each subnet range plus two. For VPCs with multiple CIDR blocks, the IP address of the DNS server is located in the primary CIDR. For more information, see Amazon DNS Server.
10.0.0.3: Reserved by AWS for future use.
10.0.0.255: Network broadcast address. We do not support broadcast in a VPC, therefore we reserve this address.

How to develop DNS for instances and that DNS names are not accesed outside Amazon Web Services cloud?

I have many instances in my amazon web service cloud now i want to develop DNS for server and all instances will have elastic IP. Now i want to do something by which DNS cannot be acceded outside i.e. want to develop DNS only for internal instances.
Do you want to run DNS on EC2 or outside the network? Remember EC2 instances with an elastic IP address have an "internal" (natted) IP address. Do you want DNS to return the internal IP addresses or the elastic (public) IP addresses?
I think the easy solution is this. On whatever machine or instance you run the DNS server on, put up a firewall on that box such that only AWS addresses (e.g. in the 107...* and 50...* range) are permitted. Or restricted to just your instance/elastic IP addresses. Configure the IP address of this DNS server to be the primary DNS server for your other instances.
Another easy solution is to run all your instances on a VPC. All the instances that need to be accessed from the public can still have elastic IP addresses. Then run a DNS server on another instance on this VPC - but without an elastic IP address. This means your DNS server would be at 10.0.0.3 or something. That IP address won't be accessible to the outside world, but is internally reachable by machines within the VPC. I'm not sure of the network topology between your instances are, but if they only need DNS to communicate between each other, then you could even have a public DNS server that returns the 10.x.y.z addresses for instances on the VPC.