I have setup bind server using the following link

And added few extra lines in /etc/bind/named.conf.options as

Recursion yes;
allow-query {; };

and an extra lamp server with web server for example.com hosted on bind server machine with ip

Now I configured two separate machines with ip and 2.4 with dns 2.2 for each.

Now I want that machine should be able to open locally hosted example.com and all other queries pertaining to other websites should be resolved by

And machine with should not be able to resolve locally hosted example.com but its dns queries should directly be resolved by open dns.

Both machines dns will remain but above scenario should also be fulfilled.

1 Answer 1


I don't know if bind overrides these, but you could try to direct queries to example.com to your httpd server, by settings the IP address of your lamp host in /etc/hosts of the machine, e.g.:    example.com

As for "machine with should not be able to resolve locally hosted example.com", you could try adding this to /etc/hosts in in order to block the access to example.com:    example.com

or some other IP address instead of, which isn't actually used by your httpd server.

  • but what about I want 2.4 to access example.com resolved from and even I will not be having access to 2.3 machine to do changes in its /etc/host file. What I have is access to just my dns server with apache server hosted on it.
    – J. white
    Apr 22, 2017 at 13:02

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.