DHCP custom set hostname are not resolving
-
I some devices that I would like to change the hostname on - by default some have picked up the hostname from the device and some just had the device IP as the hostname.
As a test, i changed one of the hostnames from lenovo123 to lennovotest by adding the device as a static device leaving the IP blank as I still want the IP to be dynamic. I test released and renewed the IP on the device and under system log\DHCP, it just shows the old name. The old name is also in my AdGuard Home DNS hostname.
Any ides? Thank you
-
@iptvcld said in DHCP custom set hostname are not resolving:
Any ides?
The most obvious one.
Netgate Adds Kea DHCP to pfSense Plus Software Version 23.09What do you use ?
Btw : when you set up a 'DHCP Static MAC Lease', you don't change the name of the host on the host itself.
What you do 'change' is that the host name you've decralred is writtien in to the local pfSense cache, so your other network device can now use this name, and find the IP of your device. -
@Gertjan I am using ISC DHCP, I am also aware that changing the hostname vis pfSense will not change the actual host name of the client device.
My question is, how can I change the DHCP resolved hostname without setting a static IP? When i set a static IP and change the hostname under the static mapping section, the new hostname name is able to be resolved via pinging that, however when I try to do the same without setting an IP, the name does not resolve.
-
@iptvcld Personally I never understand this line of thinking... If your going to take the time to want to resolve some fqdn to set it up in a reservation.. Just set the IP while your in there..
So you want to set the name, but just pull some whatever IP from the pool? Why not just set it? That way even if dns fails to resolve - you prob know what its IP is ;)
-
@johnpoz I was thinking that as well but I have a bunch of dynamic IP devices that just have the IP as the hostname in pfSense. Sometimes these devices will need to join a different VLAN (for whatever reason, testing, etc..) and if i ser that device to a static IP on LAN lets say then if i were to connect that device to a different WIFI on VLAN 10 for example IOT, then that will break as the static set IP would not be in the same range.
dont know why this does not work by setting the mac with a custom hostname - it should update and resolve.
-
@iptvcld said in DHCP custom set hostname are not resolving:
hen that will break as the static set IP would not be in the same range.
huh?? Why would you set it on the device.. Set the reservation in dhcp, now if on network A it gets IP address X, if it moves to network B set that reservation to give it IP address Y.. Which is on the B network, etc.
Example I have my ipad so it always gets the same last octet on whatever wifi network its on.. Be it my roku network, or my psk network or my trusted network it auths with eap-tls, etc.
-
@johnpoz oh that makes sense.. and good tip for setting the last octet. So it looks like i still need to set the ip as well? I was hoping not to TBH., but if it is not possible then I have no choice.
-
@iptvcld Not sure if not possible - to be honest have never tried it.. Since it makes no sense to me to ever do such a thing. If I want to be able to resolve something, and going to take the time to setup a reservation so it has the name I want, why would you not just set the IP??
-
@johnpoz I am going to have to decrease my DHCP scopes and leave more space as I did not account for many statics.
-
@johnpoz while on this topic, how do you manage devices that have 2 mac addresses such as a laptop (wifi and ethernet) - would you have to add 2 static entries? Or is there a better way perhaps via Client Identifier
-
@iptvcld I don't really have such devices.. The only devices on my wifi are devices that are mobile - I really don't have anything that moves from wired to wireless all the time?
My pc the wireless is disabled, my work laptop is wired while I am home working..
If I did fire up my wireless interface on either of those devices I wouldn't really care what its IP is, etc.
But if you have some device that you move about from wired to wireless, just setup 2 different IPs for the different macs..
-
@johnpoz or I can setup 2 statics for each Mac using the same IP to sure if a device roams from eth to wifi that the IP will remain the same. I am using AdGuard Home as my dns server and a device may have some additional rules based on the set IP. So if that IP changes, I will have issues and unfortunately AdGuard cannot identify via MAC unless I use their DHCP server.
-
@iptvcld said in DHCP custom set hostname are not resolving:
I can setup 2 statics for each Mac using the same IP
Yeah I don't think it will let you do that.. I don't think it will let you set a reservation for mac abc to 192.168.1.100 and mac xyz to 192.168.1.100
-
@johnpoz Ok so it works, but not the best. I had to reboot the laptop each time even if I do a release and renew - not the best. Seems like I will need to have 2 IPs reserved for a laptop with host names such as LenovoWifi/LenovoEth and then in AdGuard (my DNS) - I would need 2 persistent clients using both IPs and have the same custom filters for both. Dirty..
-
@iptvcld said in DHCP custom set hostname are not resolving:
I had to reboot the laptop each time even if I do a release and renew - not the best
If it's a windows PC :
ipconfig /release ipconfig /renew
will do.
And that's even not needed.
A cable disconnect, and the device will 'loose' that lease by default.
When you select then with the Wifi a SSID, a lease will be obtained automatically.When going back to cable, it might be best to actually disconnect - mouse click - from the SSID, and then put the cable in place.
Always worked for me like that for the better part of this century.
Info valid for every possible OS.