0

In /etc/hosts, I can for example input

127.0.0.1   example.com

Now I have a nameserver (pdns with postgre-backend), which I want to use in the intranet.

So, I tell my dns server, that example.com is, for example, 192.168.1.24

Assuming the DNS server runs on 192.168.1.64, how can I replace /etc/hosts with my nameserver ?

That is to say, it should resolve example.com to 192.168.1.2 (using the DNS on 192.168.1.24), but any other domain that I did not overwrite locally should be resolved to its real IP, using whatever is used by default.

Where do I have to put this in Ubuntu 14.04 ?

5
  • Comment out the entry from /etc/hosts, since it has priority over entries from DNS.
    – muru
    Oct 14, 2015 at 10:55
  • @muru: That much is clear...
    – WitchCraft
    Oct 14, 2015 at 11:31
  • @muru does /etc/hosts priority can be set in nsswitch? Oct 14, 2015 at 11:41
  • @AizuddinZali Yes, but not for a single site. Just move dns before files
    – muru
    Oct 14, 2015 at 11:42
  • @muru, ok make sense he only want single site. Oct 14, 2015 at 11:43

0

Browse other questions tagged or ask your own question.