0

I'm trying to complete the setup of my Bind9 DNS server.

Both Systems are running Debian Stretch. The serving machine (192.168.0.113) is a VM host and the client machine (192.168.0.104) is its virtual guest.

The server seems to be running without complaint, but I'm getting some confusing results. The host command resolves as I'd hoped:

$ host wiles.local
wiles.local has address 192.168.0.113

However I'm unable to reference the system by hostname anywhere else:

$ ssh wiles.local
ssh: Could not resolve hostname wiles.local: Name or service not known

Of course, I can ssh into the system by referencing the IP explicitly without issue.

The client machine does seem to be looking in the right place for its DNS:

$ nslookup google.com
Server:         192.168.0.113
Address:        192.168.0.113#53

Non-authoritative answer:
Name:   google.com
Address: 216.58.192.206

I'm hoping someone can help me figure out what the distinction here is and what I can do to fix the issue.

I'll give what relevant config information I know:

On the serving system:

/etc/bind/named.conf.local

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

/etc/bind/db.wiles.local

$TTL    86400
@       IN      SOA     wiles.local. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                          86400 )       ; Negative Cache TTL
;
        IN      A       192.168.0.113
@       IN      NS      localhost.
www     IN      A       192.168.0.104

On the connecting system:

/etc/network/interfaces

auto lo enp0s3
iface lo inet loopback

iface enp0s3 inet static
        address 192.168.0.104
        netmask 255.255.255.0
        gateway 192.168.0.1
        dns-nameservers 192.168.0.113

And finally:

/etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.113

A note on the last file: I had to disobey the loud warnings and write that line in by hand. Until having done that, this system would not resolve host names for ANY service, external or internal. I believe this to be a separate issue, that was fixed by installing and running resolvconf, but I mention it just in case the problems are related.

  • 2
    Please don't use .local as your own private TLD. It is reserved for Multicast DNS. – Johan Myréen Apr 10 '18 at 5:01
  • 1
    Check grep ^hosts: /etc/nsswitch.conf and see askubuntu.com/questions/843943/… Note host nslookup dig use DNS directly and do NOT use nsslib like normal programs so you cannot rely on them to give the same results. – dave_thompson_085 Apr 10 '18 at 8:27
  • Check this out – kemotep Apr 10 '18 at 13:28
  • @dave_thompson_085 I get the following output: files mdns4_minimal [NOTFOUND=return] dns myhostname This "myhostname" tag looks like it should be replaced with something else. – Nathan Wiles Apr 10 '18 at 21:47
  • @JohanMyréen changing from TLD .local to .com did the trick, thanks! Please post this as the answer. – Nathan Wiles Apr 10 '18 at 21:55
0

As pointed out in the comments by Johan Myréen, my issue appeared to be caused by the use of a reserved TLD. Since I'm not making use of mDNS, switching from .local to .com allowed my name resolutions to work properly.

  • that may cause unknown issues down the road as well. I use .homenet ... – ivanivan Apr 16 '18 at 1:36
  • I've reserved the domain from a registrar. That should make sure I don't run into any issues going forward as long as I still own it, right? – Nathan Wiles Apr 16 '18 at 1:38

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.