Use a different dns server for some specific domains

I want to use a different dns server for some specific domains that are blocked by the default dns server. And i dont wanna change my default dns server for some reason.

Is there any way of doing this without installing my very own dns server?

I've just learn that this is possible in mac: http://hints.macworld.com/article.php?story=2004062902195410


Take a look at this.

I know this is kind of a late answer but I just tried it and it works.

To summarise it,

  1. Create/edit /etc/NetworkManager/dnsmasq.d/custom-dns
  2. Add these lines so that domain.intra will be resolved by 192.168.30.1 and home.intra will be resolved by 192.168.0.1. We can add as many lines as we want. server=/domain.intra/192.168.30.1 server=/home.intra/192.168.0.1
  3. Restart network manager by sudo service network-manager restart.

And that's it.

Hope this helps.


There seems to be no DNS routing support in the GNU libc, so the same trick they use in the Mac article you cited will not work on Linux.

Dual DHCP/DNS server is a DNS server that supports DNS routing according to the docs (you can turn the DHCP features off).