Call DNS server based on domain query
I have a strange setup here and I need to do some tweaking to get it solved.
I'm on a network where all DNS queries to Dynamic IPs (dyndns.com) are redirected to a "don't go there" IP.
So I tought about setting a static external DNS server IP in my resolv.conf using /etc/dhcp/dhclient.conf.
This works fine!
The only problem I have now, is that if I put the external DNS server first, I don't have any name resolution for the internal network, and if I put the internal DNS first, I don't have any name resolution for the dyndns domains...
How can I configure my linux to tell it to go to the internal DNS for .internal.org adresses, and to the external for everything else?
Quite interesting, insn't it?
My first thought is "why are resolutions go dyndns.org being re-directed?" If that's just your ISP, then ensure you are not breaking some sort of acceptable use policy. However, if this is where you work, bypassing your IT department's policies could be bad for you.
Having said that, when I need a more complex dns solution such as your own, I build my own dns server locally. You can then change teh settings in resolv.conf to "nameserver 127.0.0.1". You can configure zones, so that queries to internal domains get re-directed to the internal dns servers, whereas all others can get routed to the internet dns server of your choice.
I will not try to tell you how to configure a dns server: that is WAY beyond this topic.
I hope this helps...
Hi Jason_not and barlafues,
I was looking for some sort of "easy solution" to avoid having to play in my resolv.conf during the day. Setting up a local DNS server or starting to cache stuff is too complicated for the additional comfort it would bring... But anyway, thanks for your replies!
|All times are GMT -5. The time now is 04:38 PM.|