0

I have a local DNS server running Debian and BIND 9.10.3

Currently it is configured with two forwarders 8.8.8.8 and 8.8.4.4 in named.conf.options

I have created a "dk" zone

zone "dk" {
        type master;
        file "/etc/bind/db.dk";
};

that contains four A records

www.site1        IN      A       192.168.2.2
site1            IN      A       192.168.2.2
www.site2        IN      A       192.168.2.2
site2            IN      A       192.168.2.2

When i go and ping google.com, than bind act as expected and use the forwarders, because i dont have an A record for google.com. But when i ping google.dk bind uses the db.dk zone and because i dont have a A record for google.dk the ping request fails

Question How can i setup bind so if i ping google.dk and their is not a local A record for this site, it uses the forwarders?

Reason I would like to use and setup bind for this, because i have a local webserver that hosts something.dk, and when i need to access this site i would like to avoid asking (for example) 8.8.8.8 "what is something.dk's ip address" when i have it running locally.

  • Just create zones matching your actual domains, instead of the ccTLD. Or use your /etc/hosts file. – Michael Hampton Mar 14 '18 at 19:07
  • Hey Michael, thanks for your reply. I would very much like to avoid using /etc/hosts since i have multiple machines and frequently add or remove sites – Cristian Matthias Ambæk Mar 14 '18 at 19:22
2

What exactly are you trying to do here? It almost seems like you are trying to over-ride a few records on the .dk tld?

If that is the case, instead of creating a dk. zone, you might find that it would be easier to setup a response policy zone. This allows you to override specific records, and anything you don't override would fall back to using whatever the records are.

i would like to avoid asking (for example) 8.8.8.8 "what is something.dk's ip address" when i have it running locally.

Not sure how useful your method is for this. Your DNS server will cache the result, so it isn't like you would be frequently making this request very often. Not sure why you are that worried about it.

You could also just locally create the zone something.dk instead of trying to override everything.

  • Super! I figured it out after learning that their is something called a "response policy zone". But you know, you can only ask out from the knowledge you have and than acquire new knowledge. Thanks! – Cristian Matthias Ambæk Mar 15 '18 at 21:13

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.