What's new

coaxing hostname resolution

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

kfmfe04

Occasional Visitor
FW: RT-N66U_3.0.0.4_354.29-BETA1.trx

I don't know if hostname resolution code has changed since 270, but it certainly looks like it's updating much faster for me now. In fact, this build is able to resolve all machine names on my network (including DHCPed ipads) except two units with static IPs (they show up as MAC addresses in the FW):

  • a Fuji Xerox network printer
  • a Linux instance living inside virtualbox

The interesting thing is, they are all specified on an internal DNS server (bind9) so if I do a nslookup (reverse) on any IPs, including the two above, the name lookup is correct.

In the firmware itself, I have specified my internal DNS server at:

Advanced Settings/LAN/DHCP Server/DNS Server​

because I have not yet found any other place to enter this info.

In the code, I see a call to the obsolete gethostbyaddr() in lookup_hostname() in netstat-nat.c, but I don't know if this is dead or live code.

What is the best way to coax the FW to recognise these machines by name?

--------------------------------------

NOTE: this is obviously very low priority since it has no effect on the functionality of the unit. I just posted this message in hopes that someone has come across a way to resolve this kind of issue before.
 
Last edited:
The way Asuswrt handles hostnames for Networkmap (and other locations in the firmware that display a hostname) isn't based on DNS lookups, but on the use of local caches. If your device names is only hosted in that external DNS, then it will never be resolved by Networkmap.

The way I implemented name resolution in Networkmap is that, at first, the Netbios name is used (this is what Asus was doing). After that, a second check is done using the DHCP lease database, using any hostname stored by dnsmasq as it attributed a lease. This will usually take care of the vast majority of devices (anything with a dynamic lease at least, and which provides a desired hostname - some devices like other routers won't). And finally, the last pass is done by using any hostname you have entered on the static lease page. So the final result, in order of priority:

1) Name from the DHCP static reservation
2) Name provided by the device as it acquired a lease
3 ) Netbios name

In your particular case, you can easily resolve this by creating a DHCP reservation providing the IP and the hostname. Even if the devices use static IPs, this will at least give Networkmap a reference as to how to identify that IP.

Networkmap's database is what I use elsewhere on the webui to fill device names on the Per IP traffic monitoring pages, any dropdown that lets you select a LAN device, etc...

netstat-nat is only used for the page that lists NAT connections, on the Network Tools page (in 354.xx, or under Connections in 270).
 
Problem solved

Thanks, RMerlin, for that comprehensive explanation of how the FW resolves names! Although I do use SMB mounts, your post made me learn a little more about NetBIOS and the nmbd daemon.

Anyhow, I followed your instructions:

  1. In LAN/DHCP Server, I added 2 entries for my static-ly assigned IPs and hit Apply
  2. I clicked on General/Network Map/Clients and hit Refresh on Client Status

In a few seconds, the two machine names were resolved.
PROBLEM SOLVED.
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top