Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Compute Engine: Internal DNS server and issues with the resolving

Since google Compute engine does not provides internal DNS i created 2 centos bind machines which will do the resolving for the machines on GCE and forward the resolvings over vpn to my private cloud and vice versa.

as the google cloud help docs suggests you can have this kind of scenario. and edit the resolv.conf on each instance to do the resolving.

What i did was edit the ifcg-eth0 to disable the PEERDNS and in /etc/resolv.conf i added the search domain and top 2 nameservrs my instances.

now after one instance gets rebooted..it wont start again because its searching for the metadata.google.internal domain

Jul 8 10:17:14 instance-1 google: Waiting for metadata server, attempt 412

What is the best practice in this kind of scenarios?

ty

Also i need the internal DNS for to do the poor's man round-robin failover, since GCE does not provides internal balancers.

like image 445
nelasx Avatar asked Jul 08 '15 10:07

nelasx


People also ask

Which of the following is the DNS resolver for VM instance?

The metadata server is also the name server resolver for DNS queries issued by the VM.

Why Google DNS is not working?

Check that you are reaching the Google Public DNS servers If you cannot open the dns. google homepage, there may be a network problem or blocking that prevents you from reaching Google Public DNS. If your system is configured to use Google Public DNS as its DNS resolver, you may need to replace the name dns.

What IP does DNS Google resolve to?

Replace those addresses with the IP addresses of the Google DNS servers: For IPv4: 8.8.8.8 and/or 8.8.4.4 . For IPv6: 2001:4860:4860::8888 and/or 2001:4860:4860::8844 .

What is an internal DNS server?

Internal DNS servers hold all the server names and IP addresses for their domains and will share them with anyone that asks. This makes DNS a great source of information for attackers when they're trying to do internal reconnaissance. DNS caches aren't “authoritative, and they can be manipulated.


1 Answers

As mentioned at https://cloud.google.com/compute/docs/networking:

Each instance's metadata server acts as a DNS server. It stores the DNS entries for all network IP addresses in the local network and calls Google's public DNS server for entries outside the network. You cannot configure this DNS server, but you can set up your own DNS server if you like and configure your instances to use that server instead by editing the /etc/resolv.conf file.

So you should be able to just use 169.254.169.254 for your DNS server. If you need to define external DNS entries, you might like Cloud DNS. If you set up a domain with Cloud DNS, or any other DNS provider, the 169.254.169.254 resolver should find it.

If you need something more complex, such as customer internal DNS names, then your own BIND server might be the best solution. Just make sure that metadata.google.internal. resolves to 169.254.169.254.

like image 200
David Avatar answered Nov 15 '22 17:11

David