Ping is something different. a ping sends an ICMP packet to the given address. If the address is an IP, it will be routed (via ARP blah blah blah), If it is a host name, it will be resolved first to an IP via DHCP.
The resolving works through UDP port 53 (important for firewall/routing!).
→ That is the reason, why I’d prefer nslookup to analyse DNS issues over ping.
The client got one or more DNS server. A DNS server can be any system that provides a DNS service.
In our case the GL-iNet Router provides a DNS service. Here I’ll test on the Beryl AX, Firmware 4.4.6 Release 2.
My host is named ‘kira’. Out of the box, I can resolve ‘kira’ just from getting a DHCP lease.
lupus@kira:~$ nslookup kira
Server: 192.168.8.1
Address: 192.168.8.1#53
Name: kira.lan
Address: 192.168.8.168
Now I want another name for this host. So I go to ‘System - Advanced Settings’. Here I open the LuCI UI.
First I’ll check ‘Network - DHCP and DNS’. No changes needed here.
Now I switch to ‘Network - Hostnames’, that is in the same window another tab in your screenshot.
Here I add
- ‘lupuse’ for 192.168.8.168
- ‘zoe’ for 192.168.21.10
- ‘dora’ for 192.168.21.14.
lupus@kira:~$ nslookup lupuse
Server: 192.168.8.1
Address: 192.168.8.1#53
Name: lupuse.lan
Address: 192.168.8.168
lupus@kira:~$ nslookup dora
Server: 192.168.8.1
Address: 192.168.8.1#53
Name: dora.lan
Address: 192.168.21.13
lupus@kira:~$ nslookup zoe
Server: 192.168.8.1
Address: 192.168.8.1#53
Name: zoe.lan
Address: 192.168.21.10
Works as expected.
And now ping:
lupus@kira:~$ ping -c2 lupuse
PING lupuse.lan (192.168.8.168) 56(84) bytes of data.
64 bytes from lupuse.lan (192.168.8.168): icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from lupuse.lan (192.168.8.168): icmp_seq=2 ttl=64 time=0.095 ms
--- lupuse.lan ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.039/0.067/0.095/0.028 ms
lupus@kira:~$ ping -c2 dora
PING dora.lan (192.168.21.13) 56(84) bytes of data.
64 bytes from dora.lan (192.168.21.13): icmp_seq=1 ttl=63 time=7.95 ms
64 bytes from dora.lan (192.168.21.13): icmp_seq=2 ttl=63 time=3.11 ms
--- dora.lan ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 3.109/5.530/7.952/2.421 ms
lupus@kira:~$ ping -c2 zoe
PING zoe.lan (192.168.21.10) 56(84) bytes of data.
From 192.168.21.169 (192.168.21.169) icmp_seq=1 Destination Host Unreachable
From 192.168.21.169 (192.168.21.169) icmp_seq=2 Destination Host Unreachable
--- zoe.lan ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 1022ms
pipe 2
The DNS is not interested in the Network. It will stupid resolve all records, even if it does not know anything about the net 192.168.21.0/24.
As you can see this is a transfer network at my home with one host up.
Under Linux I can easily check the DNS server:
lupus@kira:~$ cat /etc/resolv.conf
search lan
nameserver 192.168.8.1
Under windows, it is somewhere in ‘ipconfig /all’ … If you have set and changed a lot on your windows, you may need a ipconfig /flushdns
to start over. See ipconfig
Please make sure there is no personal firewall/security solution/vpn client active, that is messing with your DNS settings ‘for security’.