I have setup a local raspberry pi to be a DNS server for the office. It worked (almost) perfectly, until we moved down a floor in the office.
The firewall and setup for the network is exactly the same, however my RaspberryPI DNS host doesn't.
The zones are correct and I can lookup the local domain and get the correct result. However, it doesn't ping.
From my Mac:
Pauls-MacBook-Pro:~ paulp$ nslookup mobile.domain.office
Server: 10.0.0.196
Address: 10.0.0.196#53
Name: mobile.domain.office
Address: 10.0.0.201
Pauls-MacBook-Pro:~ paulp$ ping mobile.domain.office
ping: cannot resolve mobile.domain.office: Unknown host
Pauls-MacBook-Pro:~ paulp$ ping -c 3 10.0.0.201
PING 10.0.0.201 (10.0.0.201): 56 data bytes
64 bytes from 10.0.0.201: icmp_seq=0 ttl=64 time=1.318 ms
64 bytes from 10.0.0.201: icmp_seq=1 ttl=64 time=2.562 ms
64 bytes from 10.0.0.201: icmp_seq=2 ttl=64 time=26.039 ms
--- 10.0.0.201 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.318/9.973/26.039/11.372 ms
Pauls-MacBook-Pro:~ paulp$ dig mobile.domain.office
; <<>> DiG 9.8.3-P1 <<>> mobile.domain.office
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44066
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;mobile.domain.office. IN A
;; ANSWER SECTION:
mobile.domain.office. 7200 IN A 10.0.0.201
;; AUTHORITY SECTION:
domain.office. 7200 IN NS raspberrypi.domain.office.
;; ADDITIONAL SECTION:
raspberrypi.domain.office. 7200 IN A 10.0.0.196
;; Query time: 1 msec
;; SERVER: 10.0.0.196#53(10.0.0.196)
;; WHEN: Wed Apr 27 15:05:42 2016
;; MSG SIZE rcvd: 100
The address of mobile.domain.office
is 10.0.0.201
. My mac can reach it perfectly, so can the DNS "server". The DNS server also resolved the DNS as well as my mac, yet I can't reach it. However, the DNS "server" does have a high latency and is slow to respond:
root@raspberrypi:/etc/bind# ping -c 3 mobile.domain.office
PING mobile.domain.office (10.0.0.201) 56(84) bytes of data.
64 bytes from 10.0.0.201: icmp_req=1 ttl=64 time=977 ms
64 bytes from 10.0.0.201: icmp_req=2 ttl=64 time=360 ms
64 bytes from 10.0.0.201: icmp_req=3 ttl=64 time=352 ms
--- mobile.domain.office ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 31348ms
rtt min/avg/max/mdev = 352.624/563.543/977.893/293.006 ms
As suggested here, I also changed /etc/nsswitch.conf
to have dns
after files
, that didn't help either.
From what I can see, the zones are correct too. This is the zone for domain.zone
:
;
; BIND data file for local loopback interface
;
$TTL 7200
@ IN SOA domain.office. root.domain.office. (
2 ; Serial
172800 ; Refresh
14400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
NS raspberrypi.domain.office.
domain.office IN NS raspberrypi.domain.office.
domain.office IN A 10.0.0.201
raspberrypi IN A 10.0.0.196
mobile IN A 10.0.0.201
I have also done a new reload on the name server control utility:
root@raspberrypi:/etc/bind# rndc reload domain.office
zone reload up-to-date
Also, both my Mac and the raspberry pi have the correct settings.
Ifconfig for my mac:
Pauls-MacBook-Pro:~ paulp$ ifconfig
[...]
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether ac:bc:32:95:04:bb
inet6 fe80::aebc:32ff:fe95:4bb%en0 prefixlen 64 scopeid 0x4
inet 10.0.0.185 netmask 0xfffffe00 broadcast 10.0.1.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
[...]
The raspberry pi:
root@raspberrypi:/etc/bind# ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:f4:2b:3c
inet addr:10.0.0.196 Bcast:10.0.1.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3208 errors:0 dropped:2 overruns:0 frame:0
TX packets:2353 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:844113 (824.3 KiB) TX bytes:324170 (316.5 KiB)
What am I doing wrong?