I need the ability to have specific dns servers for multiple networks, and i would like to know how to properly update my /etc/resolv.conf
:
lets say I have a major vpn, that I route all my trafiic and DNS queries through it.
But know I have another VPN that gives me specific accesss to a network, that VPN also as a DNS server, but it only serves a specific domain lets say: ´mydomain.local´
I have a constructed the following resolv.conf:
nameserver 10.8.0.1
search mydomain.local
nameserver 10.250.0.2
But the DNS queries will go on to the first domain server no matter what, changing order does not matter.
Can anyone give me any suggestion?
Best Answer
Impossible to achieve using
/etc/resolv.conf
only.I'd say the easiest thing is to install
dnsmasq
(a caching DNS client), make it the sole resolver by puttingnameserver 127.0.0.1
into/etc/resolv.conf
and then modifydnsmasq
configuration:no-dhcp-interface=
to disablednsmasq
's DHCP server facilities;server=10.8.0.1
;server=/mydomain.local/10.250.0.2
to all requests for hosts inmydomail.local
go to that server.