I was trying to migrate an A record from a public DNS to an internal DNS in Route 53. I figured something like this would be fairly straightforward:
- Remove A record for server foo.bar.net (Public DNS).
- Add A record for server foo.internalbar.net (Internal DNS).
- Modify Bastion host's resolv.conf to search for internalbar.net (both Bastion host and foo are in the same VPC). Only difference is that foo is part of a private subnet attached to a NATd Gateway.
After this is done, I cannot resolve foo when running host in the bastion host. I was getting:
host foo
Host foo.internalbar.net not found: 3(NXDOMAIN)
According to documentation, Route 53 would work within 60 seconds. I waited for about 10 minutes until I decided to revert the change. For what it's worth, the bastion host was a part of the public DNS. I even went as far as adding the bastion host to the internal DNS (it's private IP). Can anyone tell me what may have been the issue with me adding foo to the internal DNS server?
Best Answer
I'm going to make a couple of assumptions about your current setup:
internalbar.net
is a "private hosted zone" (based on your comment about "internally" hosted DNS).foo
exists in the above zone.So, now for the answer! Your DNS sever in
/etc/resolv.conf
should be the 2nd usable address in your VPC's CIDR block. For example, if your VPC's CIDR is10.0.0.0/16
, then the resolver would be10.0.0.2
.Once you do that, it will resolve.
Reference for reserved VPC addresses: VPC Subnets