Reply
New Member
Posts: 28
Registered: ‎06-18-2015
Kudos: 5
Solutions: 1
Accepted Solution

Duplicate Hostnames Cause DHCP to Stop

I had two networks set up in the EdgeRouter: one for data and one for voice. While configuring the device via the GUI, I had set up a phone with the name of "Chief" and then a computer in the other network with the same name of "Chief". I figured since they were in seperate LANs that it would make a difference and I didn't receive any notice from the GUI that duplicate hostnames were disallowed.

 

It wasn't until the next day after DHCP leases started expiring that I got a call from work in a panic when the computers and phones were no longer working.

 

Long story short, it was the duplicates that prevented DHCP from working.

 

I don't know if this is considered a 'bug' or something 'nice to have' but I would like at least a warning from the GUI and/or CLI that identical hostnames aren't allowed.


Accepted Solutions
Ubiquiti Employee
Posts: 2,699
Registered: ‎10-05-2015
Kudos: 1018
Solutions: 220

Re: Duplicate Hostnames Cause DHCP to Stop

Thanks @mygeek911 We are working on this and it should be fixed in the next version.

View solution in original post


All Replies
Veteran Member
Posts: 6,616
Registered: ‎03-24-2016
Kudos: 1723
Solutions: 759

Re: Duplicate Hostnames Cause DHCP to Stop

It would also be nice if a service is restarted by a configuration change, this is followed by a check to see if service does start succesfully.

And if it doesn't, throw an error.

 

Ubiquiti Employee
Posts: 2,699
Registered: ‎10-05-2015
Kudos: 1018
Solutions: 220

Re: Duplicate Hostnames Cause DHCP to Stop

I got a warning for duplicate names when adding the same name in static mapping for the same DHCP server in the GUI as well as using the DNS host names wizard. It does allow having the same name in a different server. Are you saying there was an issue having two static mappings using the name "chief" on two different DHCP servers where both of those clients wouldn't get an address with DHCP? I will test and see if I can replicate this.

New Member
Posts: 28
Registered: ‎06-18-2015
Kudos: 5
Solutions: 1

Re: Duplicate Hostnames Cause DHCP to Stop

[ Edited ]

Yes, I had one DHCP server for 192.168.1.0/24 and another for 192.168.2.0/24. The name "Chief" was on both DHCP servers, but they went to different devices. And I should have mentioned this is with the 1.9.0 firmware.

Ubiquiti Employee
Posts: 2,699
Registered: ‎10-05-2015
Kudos: 1018
Solutions: 220

Re: Duplicate Hostnames Cause DHCP to Stop

Thanks @mygeek911 We are working on this and it should be fixed in the next version.

New Member
Posts: 2
Registered: ‎08-11-2017

Re: Duplicate Hostnames Cause DHCP to Stop

Hello Forum,

This is my first post and first Ubiquiti product (EdgeRouter X)...I am really enjoying this device.

I have encountered this same issue using DHCP with static mapping and wanted to confirm the limitation.

Is the (future?) intended fix to allow duplicate names per subnet, or is the intended fix to just prevent DHCP from stopping?

An example of my configuration is below:
- v1.9.7
- LAN_A: eth1 (10.100.1.0/24)
- LAN_B: eth2 (10.100.2.0/24)
- DHCP Server for each LAN/subnet
- Static mapping named "NAS" in each DHCP Server (where each NAS is a different machine, MAC and IPs assignment matching it's respective subnet.)

In the CLI configuration / Config Tree, the 'static-mapping' elements specify MAC:IP pairs and are grouped by subnet. However, it seems that the NAME(ID) of each must be unique across all DHCP Servers regardless of subnet.  If the same name is used, then the DHCP service fails to offer IP assignments (static or otherwise). It seems the log reports an error about finding a duplicate name and it stops processing.  There is also a "WARNING: Host declarations are global...".


Thanks!

Established Member
Posts: 1,549
Registered: ‎05-03-2016
Kudos: 540
Solutions: 151

Re: Duplicate Hostnames Cause DHCP to Stop

There is only one DHCP server that manages multiple subnets each with different configurations.

What do you expect to happen when you try to configure the same name for two different IP addresses even if those addresses are in different subnets? The name to IP address mapping is handled by the local DNS forwarder. When something asks for the name to be resolved, which IP address do you want back? Names are not resolved with respect to a particular subnet. How could you access NAS in subnet B from subnet A if NAS always resolved to the NAS in subnet A for hosts in subnet A? It makes no sense. So what you ask for is never going to happen.

Now the error handling when such a mistake is made is a proper issue.
Veteran Member
Posts: 6,616
Registered: ‎03-24-2016
Kudos: 1723
Solutions: 759

Re: Duplicate Hostnames Cause DHCP to Stop

It's quite valid to have multiple DNS entries for a single name.  IP addresses can be returned in round robin mode, and this can be used to load balance  to multiple hosts.

 

But the DHCP server failing because of duplicate reservation name is really bad.  If the service itself can't handle this, then make the GUI & CLI test this, and reject such changes on commit

New Member
Posts: 2
Registered: ‎08-11-2017

Re: Duplicate Hostnames Cause DHCP to Stop

[ Edited ]

Thanks for the explanation karog.  Since I had configured each LAN to be isolated from one another (firewall policies), my mind concluded I had seperate LANs (forgetting to consider router services like DNS forwarding a global service).  I will treat DHCP static-mappings then as names in a global host table regardless of LANs/subnets.

 

Yes, error handling would be better here than failed DHCP services.

 

Thanks also 16again.  In this post https://community.ubnt.com/t5/EdgeMAX/ERX-DHCP-issue/td-p/1857837 you mention trying unique names/labels in DHCP reservations for a similar situation. It seems UBNT-sandisn opened a ticket to do configuration validation checks as the ISC dhcpd server has a global scope limitation on static mappings.

New Member
Posts: 4
Registered: ‎07-13-2017

Re: Duplicate Hostnames Cause DHCP to Stop

UP!

 

 

Please, apply a fix on this as I had a hectic day in the office Man Very Happy

Ubiquiti Employee
Posts: 2,699
Registered: ‎10-05-2015
Kudos: 1018
Solutions: 220

Re: Duplicate Hostnames Cause DHCP to Stop

We are working on a validation for this so proper error messages occur when setting the same name for multiple static-maps on multiple subnets. For now, a workaround is to enable dnsmasq for DHCP. 

set service dhcp-server use-dnsmasq enable
New Member
Posts: 4
Registered: ‎10-16-2016

Re: Duplicate Hostnames Cause DHCP to Stop

[ Edited ]

i had the same happen with different names. try "ps4" and "ps4_test".

edit: if i only knew it was dhcp before i started resetting stuff to factory defaults...

Emerging Member
Posts: 61
Registered: ‎08-18-2015
Kudos: 1

Re: Duplicate Hostnames Cause DHCP to Stop

[ Edited ]

Well you are still lucky. I even delete & reinstall my whole NAS because I thought it was my controller problem.

I just figure it out yesterday.

Still no fix on this one?

Just the workaround?

Highlighted
Ubiquiti Employee
Posts: 2,699
Registered: ‎10-05-2015
Kudos: 1018
Solutions: 220

Re: Duplicate Hostnames Cause DHCP to Stop


@fei8th wrote:

Well you are still lucky. I even delete & reinstall my whole NAS because I thought it was my controller problem.

I just figure it out yesterday.

Still no fix on this one?

Just the workaround?


@fei8th The workaround is available and we are working on adding proper validate when using the same static-mapping name across multiple DHCP servers.

Reply