after switching from FritzBox to MikroTik as my DHCP/DNS server, my clients stopped resolving short dns names.
i need to explicitly trigger regexp entries, otherwise dns resolve fails
root@fServer:~
#> ping -c 1 Monster
ping: Monster: Der Name oder der Dienst ist nicht bekannt [i](name or service is unknown)[/i]
root@fServer:~
#> ping -c 1 test.Monster
PING test.monster (192.168.109.3) 56(84) bytes of data.
64 bytes from monster (192.168.109.3): icmp_seq=1 ttl=128 time=0.149 ms
--- test.monster ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.149/0.149/0.149/0.000 ms
root@fServer:~
#> ping -c 1 Monster.lan
PING monster.lan (192.168.109.3) 56(84) bytes of data.
64 bytes from monster (192.168.109.3): icmp_seq=1 ttl=128 time=0.147 ms
--- monster.lan ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.147/0.147/0.147/0.000 ms
root@fServer:~
#> ping -c 1 test.Monster.lan
PING test.monster.lan (192.168.109.3) 56(84) bytes of data.
64 bytes from monster (192.168.109.3): icmp_seq=1 ttl=128 time=0.150 ms
--- test.monster.lan ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.150/0.150/0.150/0.000 ms
but dig has no problems resolving DNS entries:
root@fServer:~
#> dig Monster
; <<>> DiG 9.11.5-1-Debian <<>> Monster
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43107
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;monster. IN A
;; ANSWER SECTION:
monster. 10 IN A 192.168.109.3
;; Query time: 1 msec
;; SERVER: 192.168.109.5#53(192.168.109.5)
;; WHEN: Do Nov 22 13:55:59 CET 2018
;; MSG SIZE rcvd: 41
looking at the log on my MikroTik, i see the dns query packets for “ping -c 1 Monster” missing.
that means i probably messed up my dhcp config somewhere.
/ip address add address=192.168.109.5/24 interface=bridge1 network=192.168.109.0
/ip route add distance=1 gateway=192.168.109.1
/system ntp client set enabled=yes primary-ntp=192.168.109.1
/ip pool add name=dhcp_pool ranges=192.168.109.200-192.168.109.254
/ip dhcp-server add add-arp=yes address-pool=dhcp_pool disabled=no interface=bridge1 name=dhcp_v4
/ip dhcp-server config set store-leases-disk=never
/ip dhcp-server lease add address=192.168.109.9 allow-dual-stack-queue=no client-id=fServer
/ip dhcp-server network add address=192.168.109.0/24 dns-server=192.168.109.5 gateway=192.168.109.1 ntp-server=192.168.109.1 wins-server=192.168.109.9
/ip dns set allow-remote-requests=yes cache-max-ttl=1m servers=192.168.109.1
/ip dns static
add address=192.168.109.9 comment="File Server name" name=fServer ttl=10s
add address=192.168.109.9 comment="File Server match" regexp="(.+\\.)\?f[Ss]erver(\\.[Ll]an)\?" ttl=10s
add address=192.168.109.3 comment="Gaming Monster name" name=Monster ttl=10s
add address=192.168.109.3 comment="Gaming Monster match" regexp="(.+\\.)\?[Mm]onster(\\.[Ll]an)\?" ttl=10s
edit:
i am dumb. i forgot to set domain in dhcp config.
/ip dhcp-server network add address=192.168.109.0/24 dns-server=192.168.109.5 domain=lan gateway=192.168.109.1 ntp-server=192.168.109.1 wins-server=192.168.109.9
now “it just works”.