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.
.local
as your own private TLD. It is reserved for Multicast DNS.grep ^hosts: /etc/nsswitch.conf
and see askubuntu.com/questions/843943/… Notehost nslookup dig
use DNS directly and do NOT use nsslib like normal programs so you cannot rely on them to give the same results.files mdns4_minimal [NOTFOUND=return] dns myhostname
This "myhostname" tag looks like it should be replaced with something else..local
to.com
did the trick, thanks! Please post this as the answer.