How to have both Local DNS + Google DNS all the time [closed]

I need to resolve both my local network devices + public internet domains from my windows PC. My local ISP’s DNS server is quite sucky at resolving public domains so I want to use Google DNS for higher reliability, but also want to be able to access the local network resources in my subnet.

Although I can statically configure the NIC properties to have both Primary and Seconday DNS setting, but I also happen to move with my laptop across networks.(home\office) So I want the Local DNS to be always dynamically set but the Google DNS to remain statically configured on my NIC always.

What is the best possible approach to get DNS from DHCP and add GoogleDNS on top of it statically.

Answer

The best way in my opinion is to have a local forwarding DNS server.

Perhaps your DNS server is contacting the root servers? You just need to have it forward requests to somewhere fast – Google.

A DNS server can store your local records, and when a record isn’t found it will forward the request to Google’s DNS servers. You can have the added benefit of caching results on your server for better performance.

DNSMasq, unbound, bind do this. If you’re on Windows, I can’t give any suggestions – you haven’t mentioned your DNS server OS. I think some routers have this functionality built in too.

According to this article, DNSMasq forwards by default to whatever is in /etc/resolv.conf. So it seems all you need to do is add your local host entries.

https://wiki.debian.org/HowTo/dnsmasq

So you get this:

request -> local dns (return if found) -> google dns ->
result -> local dns (add to cache) -> requester

Unbound works on Windows. Some others I listed may too. I’m sure there are many options for you.

https://www.unbound.net/

Now that you’ve explained a bit more about your situation
You will need to configure the DNS server on your workstation and tell it about any internal domains and that it should query your existing slow DNS server for that info. It can then query google for everything else. You’ll have to configure your workstation to query 127.0.0.1 instead of the regular slow DNS server. If you enable caching, you may find that internal lookups are faster sometimes too.

Attribution
Source : Link , Question Author : Vishal Naidu , Answer Author : Ryan Babchishin

Leave a Comment