0

I have configured the following two ubuntu 16.04 machines:

dns client:  192.168.248.190
dns server (bind9): 192.168.242.116

I basically followed this and only setup the forward zone file https://www.digitalocean.com/community/tutorials/how-to-configure-bind-as-a-private-network-dns-server-on-ubuntu-14-04

On my dns server, I have the following:

*/etc/bind/zones/db.myinternal.com*

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns1.myinternal.com. admin.myinternal.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;name servers - NS records
    IN      NS      ns1.myinternal.com.


; name servers - A records
ns1.myinternal.com.          IN      A       192.168.242.116

; myinteral - A records
cassbt.myinternal.com.         IN      A   192.168.248.192

/etc/bind/named.conf.options

options {
        directory "/var/cache/bind";
        recursion yes;
        allow-recursion { any; };
        forward first;
        forwarders {
               172.19.1.14;
                8.8.8.8;
                8.8.4.4;
         };
        dnssec-validation auto;
        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

Basically, I want the clients to first query this dns - 172.19.1.14. If the name can't be resolved, then I want 192.168.242.116 to resolve the name for me.

On my ubuntu client, I set the following:

/etc/resolvconf/resolv.conf.d/head

nameserver 192.168.242.116

And then ran the command:

sudo resolvconf -u

When I do

$ nslookup cassbt.myinternal.com
Server:         192.168.242.116
Address:        192.168.242.116#53

Name:   cassbt.myinternal.com
Address: 192.168.248.192

This is expected. However, when I do

nslookup product-ci
Server:         172.19.1.1
Address:        172.19.1.1#53

** server can't find product-ci: NXDOMAIN

This should have been resolved by DNS 172.19.1.14. When I do a nslookup on a third machine which is in a different network it gives me the following:

$ nslookup product-ci
Server:  webtest.somedomain
Address:  172.19.1.14

Name:    product-ci.somedomain
Address:  192.168.142.81

How should I configure the DNS so that product-ci dns is resolved correctly?

  • 1
    nslookup should be given fully qualified names. The domain suffixes for normal use should be declared with a search directive in /etc/resolv.conf – roaima Aug 12 '17 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.