0

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 { 0.0.0.0/0; };

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

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

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

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

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

0

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 192.168.2.3, e.g.:

192.168.2.2    example.com

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

127.0.0.1    example.com

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

1
  • but what about I want 2.4 to access example.com resolved from 8.8.8.8 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 '17 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.