Assign hostname to local IP address
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- My Router
- :
- Assign hostname to local IP address
Assign hostname to local IP address
17-01-2017 10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have a linux fedora box that starts up and with dhcpclient obtains a lease from the router's dhcp server, and the dhcp client is configured to send this to it:
send host-name "myserver"; # added by NetworkManager
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
option ms-classless-static-routes code 249 = array of unsigned integer 8;
option wpad code 252 = string;
also request rfc3442-classless-static-routes;
also request ms-classless-static-routes;
also request static-routes;
also request wpad;
also request ntp-servers;
however:
1. in the web interface to the router, under My home network/wired, sometimes I see the IPaddress/Ethernetaddress and the name correctly.
2. some other times I see no entry at all for that IP in the list (but the box is still working)
3. at other times, I see "Unknown" in the name instead of the proper hostname
Any ideas?
Thanks

Re: Assign hostname to local IP address
17-01-2017 11:14 AM - edited 17-01-2017 11:15 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Assign hostname to local IP address
17-01-2017 11:20 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I think that was for assigning the box's hostname from the dhcp server's response.
In my case, the router itself shows (through its web interface) a wrong "unknown" hostname.
also, when i query the router's dns, it says it doesn't know about the suggested hostname.
the snippet in my initial post is the dhcpclient hook/cfg file and it does get sent to the router, which successfully assigns the hostname to the Ip address it returns, but that just doesn't last forever.

Re: Assign hostname to local IP address
17-01-2017 11:54 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Assign hostname to local IP address
18-01-2017 9:55 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
no luck.
i restarted the box.
then i see on http://192.168.1.254 wired the correct name for my box IP. i could query the dns server for it too.
then after 30mns, it just became unknown again on the page, and dns too

Re: Assign hostname to local IP address
19-01-2017 7:55 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Well host names doesn’t actually come from DHCP but DNS so you may want to have a look at the router to see if you can assign host names to devices. If it can’t do this then you’ll need to adopt another approach. I assume setting the hostname on the client has no permanent effect?
At the moment I use bind9 for my own DNS which is serious overkilll so much so that I intend to replace it and my DHCP server with dnsmasq running on a Pi with Arch Linux as the OS.
Re: Assign hostname to local IP address
19-01-2017 8:23 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
No but my assumption is that the dhclient that starts at bootup of the box sends the desired hostname to dhcp server on the router which then configures it on the dns server on the router. Otherwise, how would the router show properly the sent hostname initially?
the plusnet router's web interface has no other access to configure the dns server?

Re: Assign hostname to local IP address
19-01-2017 10:21 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I agree so it would appear then that the weakest link here is in fact the Plusnet router, so maybe one of the Plusnet staff can confirm if this facility is supported. So to pre-empt them, what model router do you have?
Re: Assign hostname to local IP address
19-01-2017 1:44 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
sagemcom 2704N is what i read underneath.
Re: Assign hostname to local IP address
20-01-2017 7:59 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Support staff are notoriously non technical.
1 thing i noted though is that my other windows PC appears fine however. Its name appears in dns and router web interface
So this points back to the linux dhclient doing something different from the windows one
Re: Assign hostname to local IP address
20-01-2017 8:23 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
It's not necessarily solely related to DHCP. The router might also use other protocols such as Windows networking protocols or even UPnP / SSDP to detect device names.
Leaving samba services running just so that the router shows the correct name seems a bit overkill though.
Re: Assign hostname to local IP address
20-01-2017 8:27 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
It's for the router dns server to assign the correct name to the iP that the dhcp server gives to my Linux box.
I don't see a way to do that statically in the router Web interface
Re: Assign hostname to local IP address
31-01-2017 7:32 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
To recap, the windows 7 pc gets its name assigned correctly at the router level and the dns level and stays like that all the time.
The Fedora linux box gets its name assigned correctly for a short period of time (the dhclient sends it to the router), then it disappears.
Is there a next step to investigate more accurately what's going on?
Regards,
Re: Assign hostname to local IP address
31-01-2017 8:02 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
If you have a firewall enabled on the Fedora box, configure it to log everything incoming that it blocks. Then you'd be able to see if there's anything that you need to allow through the firewall. Or disable the firewall or change it to allow everything. Maybe then leave wireshark capturing for a while until the problem occurs, which might capture something the router sends that the Fedora box doesn't reply to.
Or you could try running having samba services running and see if they fix it.
Re: Assign hostname to local IP address
31-01-2017 8:47 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I could be missing the something here, but I believe you want to name the device via the routers home network page... (y/n)? Because the router keeps losing it's name (y/n)?
I can't comment on early PN routers, but it is possible on the PNH1 and all BT Home Hub's, so assume it can be done on yours too.
Via the home network page, if you get a page similar to the one I've included (though I have removed information from the page prior to posting), then look for your device, click on the text and it should open a new page. From there you can name it anything you like, and this overrides the name the device. You would need to click apply for each device name change.
for example, my YouView-TV box name has been changed from it's default name.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- My Router
- :
- Assign hostname to local IP address