LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   can a local DNS Server be used to handle dns requests going out to the internet (http://www.linuxquestions.org/questions/linux-server-73/can-a-local-dns-server-be-used-to-handle-dns-requests-going-out-to-the-internet-4175414559/)

baronobeefdip 07-03-2012 12:02 AM

can a local DNS Server be used to handle dns requests going out to the internet
 
I am running an experiment to see if i can make my own DNS server request IP address from the internet but instead i want to mic up the addresses a little just as an experiment. What I want to do is make my local DNS server handle the requests that are going out on the internet for instance. I want to put an A record in the zone file to respond to a request for google.com and instead of giving google to the client i want it to give it a different web site (like bing or yahoo)

what i have so far is that i made the zone statement in the named.conf look like this
Code:

zone "." {
type master;
file "zones/master";
};

and the NS and A records look like this
Code:

            IN    NS    .
.          IN    A    192.168.1.106 (local ip address for my DNS Server)
google.com  IN    A    131.253.13.32 (the ip address for bing)

when it starts to browse the connection fails even though the A record has an ip address to go to so what is the problem here, even if i try to go to facebook which doesn't have an A record and it still fails. when an A record is unavailable how do i make it move on to the google public dns server which is 8.8.8.8.

TenTenths 07-03-2012 04:19 AM

Look up the many, many, many "how-to" documents for setting up a "cache dns server" based on your distribution of linux and choice of name server.

Then, to over-ride lookups you will need to create and load zone files for the domains you wish to over-ride. You would most likely want to structure this zone with the "real" NS records for the domain you're messing with and then over-ride the entries you want to fake.

Note that in BIND, an A record that starts google.com in a google.com zone will be decoded as an A record for google.com.google.com due to the way BIND construts FDQNs. Also even setting an A record for google.com does not make it a wildcard for www.google.com etc.


All times are GMT -5. The time now is 09:44 PM.