I want to configure local domain zone in bind9 like "example.com" for local lan to add some hosts only. but if I configure that I am unable to connect to "example.com" which is public registered domain. how can I redirect in bind9.

  • 1
    I'm not quite answering the question (hence the comment and not an answer). You can use DNSMasq instead of bind (it is DHCP and DNS server). It can forward all DNS queries to external DNS and you can specify a local hosts, which will not be forwarded to external DNS. i.e. you can add "local=/myzone.example.com/" to the configuration and all queries to *.myzone.example.com and the host iself will be answered from /etc/hosts file, instead of a real DNS. Another way is to add "address=/doubleclick.net/" in the config, which is easier probably. – 0xAF Feb 20 '17 at 13:26

If you do not have ownership of the domain in question, you should never do this; it is considered rather rude. For exactly example.com, however, when testing things, that's fine.

DNS clients will ask their configured nameservers for a domain name. If that server does not have any knowledge of the domain they're querying, then it must go and ask the root servers for more information about the location of the data. The resulting query process is somewhat involved, but at any rate, unless you're the official owner of example.com, that's not going to work. If the server(s) that are being queried first do have the required information though, then they don't need to query the root servers but can just return the wanted information.

In other words, you need to configure the machines you want to query your zone with your bind instance; if you've done that, it should just work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.