[Solved] Accessing hosts on my network by hostname

I have checked and tried various threads on this issue and I cannot figure out what has changed (it was working at one point).
I can access devices by IP address but not by their host name. I am using dynamic address allocation but binding to specific addresses by MAC on the router. I cannot even access the router itself by host name.

config dnsmasq
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option domainneeded '1'
        option localise_queries '1'
        option rebind_protection '1'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option local '/mydomain.com/'
        option domain 'mydomain.com'
        option localservice '0'
        option nonwildcard '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option ra 'server'
        option dhcpv6 'server'
        option ra_management '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

config domain
        option name 'andraia'
        option ip '192.168.1.103'

config domain
        option name 'phong'
        option ip '192.168.1.223'

config domain
        option name 'megabyte'
        option ip '192.168.1.209'

I would try making the hostnames Fully-Qualified Domain Names. This means adding a domain to the end of the hostname.

config domain
        option name 'andraia.foo'
        option ip '192.168.1.103'

config domain
        option name 'phong.foo'
        option ip '192.168.1.223'

config domain
        option name 'megabyte.foo'
        option ip '192.168.1.209'

lleachii that worked perfectly. Its a bit cumbersome, but the end result is what I wanted (I can access hosts by their hostname).

Weird thing is that when I ping the router, it comes back with an IPv6 address (all other hosts return IPv4 addresses.)

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.