Using hostnames in whole network


I am using static static leases for my devices in my network.
Actually I was hoping to be able to ping them afterwards with there hostname instead of ip address. But this doesn’t work.
I was than trying to use the hostname-register. But this also doesn’t work.

What am I doing wrong?


GL GUI → System → Advanced Settings → LuCI → Network → DHCP and DNS:

  • Domain required
  • Authoritative
  • Local server: /lan/
  • Local domain: <$myMadeUpDomain>.lan
  • Rebind protection
  • Allow localhost
  • Local service only
  • Non-wildcard

[ Save, Save & Apply ]

LuCI’s password is the same password as GL GUI.

Actually my settings were like this except “allow localhost”:

E.g. for one device:
Static Leases:


The first ping takes some seconds before error comes. With the second ping the error is raised immediately.

Any other ideas?

The configure should be in host names, not static lease.


Thanks for the hint … I did so:

But the result is the same …

BTW … do I than need to specify all my relevant hostnames in “hostname”-Tab? It is not take from static leases when I understand it right

And even when I ping I get the public ip instead of

With ping [hostname] the commandline asks the system DNS. As we don’t know your setup, you could test the GL-iNet settings with:
nslookup [host] [server] … For example nslookup

Internal in the router:
Even here the internal lookup for the resolve can be different. Look at the file /etc/nsswitch.conf on the router…
hosts: files mdns4_minimal [NOTFOUND=return] dns (taken from my Linux, I have no shell to a router open)
This means if the domain name is listed in /etc/hosts (the file is included in ‘files’), than the entry in ‘mdns4_minimal’ wont be used.

As ‘’ is a system hostname, I can imagine it will be overwritten.

Better test with ‘computer’ from your list:
nslookup computer

You need to turn off “Rebind protection” to make the local lan IP is not dropped when doing DNS query.

Here some outputs:

All tested with “Rebind protection” disabled
So no difference.

The file /etc/nsswitch.conf doesn’t exist on my router.

I am a little confused about the ‘Server: unknown’.
I know this, when I forgot to setup a reverse lookup zone in AD or Bind. But this should not happen in GL-Inet router with the dnsmasq.

Is the IP of your GL-Inet Router, the one with configured hostname ‘Computer’?

yes, ist the gl-inet router with hostname ‘computer’ configured

LuCI → Network → Diagnostics → IPv4 Ping

PING mypc-win11 ( 56 data bytes
64 bytes from seq=0 ttl=128 time=1.020 ms
64 bytes from seq=1 ttl=128 time=0.973 ms
64 bytes from seq=2 ttl=128 time=0.909 ms
64 bytes from seq=3 ttl=128 time=0.901 ms
64 bytes from seq=4 ttl=128 time=1.073 ms

--- mypc-win11 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.901/0.975/1.073 ms

Certa (GL-AR750), firmware 4.3.7-release4

from router to computer it seems to work

but not the other way around

Note I don’t have Static Leases (DHCP/IP reservation) or Hostnames set within LuCI; the hostname originates fr the device itself. The DHCP range is stock 150 beginning w/ to .249 (GL GUI → Network → Lan). ‘Less is more,’ and all that.

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

Name:   kira.lan

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
  • ‘zoe’ for
  • ‘dora’ for
lupus@kira:~$ nslookup lupuse

Name:   lupuse.lan

lupus@kira:~$ nslookup dora

Name:   dora.lan

lupus@kira:~$ nslookup zoe

Name:   zoe.lan

Works as expected.

And now ping:

lupus@kira:~$ ping -c2 lupuse
PING lupuse.lan ( 56(84) bytes of data.
64 bytes from lupuse.lan ( icmp_seq=1 ttl=64 time=0.039 ms
64 bytes from lupuse.lan ( 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 ( 56(84) bytes of data.
64 bytes from dora.lan ( icmp_seq=1 ttl=63 time=7.95 ms
64 bytes from dora.lan ( 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 ( 56(84) bytes of data.
From ( icmp_seq=1 Destination Host Unreachable
From ( 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
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

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’.

my ipconfig /all gives me:

I also did ipconfig /flushdns
the “lan”-entry at the first line I just added … but it doesn’t make any difference

but the result of nslookup is still:

Doing it from another devices (linux) shows:

at least this devices knows the server … but computer isn’t found

this is maybe also of interest:

when I do this from the router itself I get

Obviously he knows the right IP but how can I interpret “Can’t find computer: No answer”??

But you don’t have AdGuardHome active? This would mess with your DNS on the router.

So lets try to switch to the router: ssh root@

root@GL-MT3000:~# netstat -tulpen | grep :53 should show something like:

tcp        0      0  *               LISTEN      22125/dnsmasq
tcp        0      0*               LISTEN      22125/dnsmasq
tcp        0      0*               LISTEN      22125/dnsmasq
tcp        0      0*               LISTEN      22125/dnsmasq
tcp        0      0 ::1:53                  :::*                    LISTEN      22125/dnsmasq
tcp        0      0 fe80::20f1:5aff:xxxx:xxxx:53 :::*                    LISTEN      22125/dnsmasq

vim /etc/dnsmasq.conf unfortunately is complete commented.
so i go with the sledge hammer grep dora /etc/* -r and got /etc/config/dhcp: option name 'dora'

here are all my configurations:

config domain                
        option name ''  
        option ip '::ffff:'                         
config domain                  
        option name 'dora'          
        option ip ''   
config domain                  
        option name 'lupuse'  
        option ip ''

Please check with cat /etc/resolv.conf if nameserver is set (cat /tmp/resolv.conf should be the same, in fact is /etc/resolve.conf a symlink to /tmp/resolv.conf in a normal OpenWrt Setup).
Than check with netstat -tulpen |grep 53 if the listening service on port 53 is dnsmasq.
Make sure at the GUI (admin Panel), that AdGuardHome and similar services are disabled.

At last step for this part, you could check if the configuration is written in /etc/config/dhcp

OK … found out what is happening …

When disabling the OpnVPN client it is working:

C:\Users\diete>nslookup computer

Name:    computer.lan

So how can I combine openvpn client with DNS to work??

In the whole thread, you never mentioned OpenVPN. You are talking about DNS in your ‘network’.

Where did you disabled OpenVPN?
Client (Computer) or Router?
Where do you want resolve your hostnames?

This is a little more complex.

  • You need to make the dnsmasq available in your VPN. Or at least accessible.
  • You need a route, to make sure the devices can reach the DNS Server (to resolve the names) and a route to make sure the clients can access the resolved IPs.

Well, I didn’t realize that OpenVPN will have an impact on DNS … that is why I didn’t mention it …
I disabled OpenVPN client on my gl.inet-Router
Hostnames shall be resolved on the Router

Client is configured like this:

Can you give me more hints on how to configure dnsmasq for VPN and how to make the right route??