1

I've setup a DNS with bind9 (9.9.5) on Ubuntu 14.04/trusty (kernel 4.4.0-59) for my local network. It is working, but sometimes it fails to find an IP of a host (e.g. ping says: ping: unknown host aypi1.bxlab).

My setup is as follows.

/etc/bind/named.conf.options:

options {
        directory "/var/cache/bind";
        dnssec-validation auto;

        auth-nxdomain no;
        listen-on-v6 { none; };

        allow-query {
          127.0.0.1;
          192.168.0.0/24;
        };
};

/etc/bind/named.conf.local:

zone "bxlab" IN {
  type master;
  file "/etc/bind/db.intra";
};

zone "0.168.192.in-addr.arpa" IN {
  type master;
  file "/etc/bind/db.0.168.192";
};

/etc/bind/db.intra:

$TTL 1D    ;

@ IN SOA bxlab. root.bxlab (
  2011102401 ; Serial
  3H         ; Refresh
  1H         ; Retry
  1W         ; Expire
  1D )       ; Minimum

                  IN NS  aypi1.bxlab. ;
aypi0              IN A   192.168.0.10 ;
aypi1              IN A   192.168.0.11 ;
aypi2              IN A   192.168.0.12 ;

ns                 IN CNAME aypi1  ;

/etc/bind/db.0.168.192:

$TTL 1D    ;

@ IN SOA ns.bxlab.  root.ns.bxlab (
  2011102301 ; Serial
  3H         ; Refresh
  1H         ; Retry
  1W         ; Expire
  1D )       ; Minimum

    IN NS  ns.bxlab.
    IN PTR bxlab.
    IN A 255.255.255.0
10  IN PTR aypi0        ;
11  IN PTR aypi1        ;
12  IN PTR aypi2        ;

I also changed my router configurations as follows:

Primary DNS: 192.168.0.11
Secondary: xxx.xxx.xxx.xxx  (DNS IP Provided by ISP)

The trouble is:

  1. After restarting bind9, nslookup worked with aypi1.bxlab.
  2. After 30 min (?), ping aypi1.bxlab returned ping: unknown host aypi1.bxlab.
  3. But waiting some seconds (maybe 6 sec?), ping became to work.
  4. 2 and 3 are repeated.

Do anybody have an idea to figure this out?

Many thanks!

  • Only your local server knows what bxlab is - but you have an ISP provided server as secondary for your router - anytime the router decides to fallback to your secondary, your query will fail – pete Jan 24 '17 at 4:49
  • @pete so you mean I need to change bxlab? Could you show me an example, or a reference web page? – Akihiko Jan 24 '17 at 16:08
  • No, you need remove the ISP's DNS IP from the router and set it up in BIND as a forwarder. – pete Jan 25 '17 at 11:43
  • I followed your comment and it is working properly for some hours. Thank you so much for your advice! – Akihiko Jan 26 '17 at 2:20
1

As @pete pointed out in the comments above, the issue was the router configuration.

I modified the router DNS setting as:

Primary DNS: 192.168.0.11
Secondary: 0.0.0.0

Then I modified /etc/bind/named.conf.options as:

options {
        [...]

        forwarders {xx.xx.xx.xx; xx.xx.xx.yy; xx.xx.xx.zz;};
        forward first;
};

The IPs in forwarders are DNS from ISP.

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.