What's new

How to add DHCP clients to router DNS

  • 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!

BosseSwede

Regular Contributor
I have two ASUS routers, one RT-AC68U and the other RT-AC86U.
They are used on different locations but are tied together using a VPN link over the Internet.
The answer to this post is probably really simple but I have not found a solution...

I am moving devices between the two LAN regularly and I would like the device to be added to the router's DNS so that the all devices on the LAN can connect to the others by using their hostnames.
Since this so far is not working I have to manually edit the hosts file of a device (like my laptop) every time another device has been attached to the network.
This is really tedious, so I hope there is a way to add the IP address of a new device to the local DNS table so the router knows how to route the call when a LAN device wants to connect to another by hostname, i.e "ping rpi-home" or similar.
Is this possible?
Most of my devices are Linux computers if that matters.
 
Set the hostname on the device, in the OS. I hope I'm not missing something obvious here in what the issue really is...
 
Then your DNS is not setup correctly somewhere. If other DHCP clients are connecting to this network without issue then the problem must be with the network configuration on your device.
 
Then your DNS is not setup correctly somewhere. If other DHCP clients are connecting to this network without issue then the problem must be with the network configuration on your device.
How does this forum work?
It seems like I cannot post anything sensible like a reply to your post. I am getting a strange message about something happening that could be seen in some browser window:
Oops! We ran into some problems. Please try again later. More error details may be in the browser console.
 
Last edited:
How does this forum work?
It seems like I cannot post anything sensible like a reply to your post. I am getting a strange message about something happening that could be seen in some browser window:
Oops! We ran into some problems. Please try again later. More error details may be in the browser console.
It's a misleading error message. You typed in a banned word or phrase. That's usually "/etc /hosts" (without the space). Just replace it with something like "/etc//hosts".
 
It's a misleading error message. You typed in a banned word or phrase. That's usually "/etc /hosts" (without the space). Just replace it with something like "/etc//hosts".
OK, below is the post I was trying to do and it does contain the "forbidden phrase" Is there a list of these forbidden words?

So I have several raspberry pi devices on the LAN and they all get their IP from the router (ASUS RT-AC68U). The IP addresses are reserved on the router so they stay the same.
If I ssh into one of these and ping the other by its hostname I get a message:
Code:
ping: unknown host xxxx

But if I put an entry for the other device into the hosts file then the ping and other commands targeting that device succeeds.

All of the devices have hostnames defined and these are presumably also sent to the DHCP server (the router) when they start up.

I do not understand what more I should do on the respective Linux device in this case...
 
Post a screenshot of the Pi's network configuration.

Also post the complete output of this command:

Rich (BB code):
nslookup otherhost
where otherhost is the host name that fails.
 
Could this be of help? Would this force a host name onto a device in DNS?
1644698331117.png
 
Colin is correct when he says that the DHCP client should automatically be added to the routers DNS. A problem you may run into is that you may need to add a "." after the host name. I did a NSLOOKUP on one of my windows clients host name and it failed. I added a "." at the end of the client host name, the lookup worked.

In the Asus router's web interface you can get a list of the current attached clients. The "Clients Name" in that list is not necessarily it host name. The Asus router lets you change the client name in that list to any friendly name you want. If that's the case, you may be able to do "ping -a {client-host-ip-addr}" to get the client's actual host name. And lastly, when you do the lookup, make sure your using the Asus routers DNS to perform the lookup.

I have some virtual Linux machines in my network and I can't find them because they aren't configured to use my Asus routers DNS but instead are using my internal domain DNS.
 

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