Reply
Highlighted
Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4
Accepted Solution

WORKED-AROUND: What is Your Solution for Local Name Resolution?

[ Edited ]

I've read through all kinds of threads on this topic, but I can't seem to find the solution. 

I recently migrated my entire home network over to UniFi, including USG, US-8-150W, UAP-AC-LR, and 2x UAP-AC-IW, and a UAP-AC-IW-PRO. I also added a UVC-G3-DOME. 

I have the UniFi Controller (and UniFi Video NVR software) running on a Ubuntu VM in my VMware vSphere virtual infrastructure. 

Prior to the migration, I was using a Linksys AC Wi-Fi router for DHCP server and local name resolution (i.e. being able to ping, or access with web browser, or map a drive to a host on the network via its hostname, and nothing else; no IP address or domain name needed). Every host on my network had(has) an IP address reservation designated by me in the DHCP server on the old Wi-Fi router, and the old Wi-Fi router provided the rest of the network name resolution based on that list. 

I've been trying to change over to letting the USG be the DHCP server for me, but when I do, all local name resolution goes away. 
So, I've still just been limping along with a hodge-podge setup where my old Linksys Wi-Fi router (with radios turned off) is acting as the DHCP server and providing local name resolution, because the UniFi stuff either isn't up to the task, or I'm just unaware of how to get it working properly. 

 

QUESTION: 
Is there a way of getting the USG (or something else in the UniFi ecosystem) to provide local name resolution, or is continuing to use my old Wi-Fi router (or something else) really my only choice at this point? 

 

EDIT: 

I just noticed that, when I do an ipconfig /release /renew on my Windows hosts, once they've reregistered with the USG's DHCP server, it seems like their IP/Name mappings are added to its list, and local name resolution works for them. 

 

Perhaps since all of the DHCP clients on the network have a very long lease time (bad idea I guess), they're all using settings given to them from the old Wi-Fi router, and never 'check in' with the USG's DHCP server in order for them to be registered there. 

So, I guess I may just need to go around and do that (release/renew DHCP lease) for all hosts on the network (which may require a complete TCP/IP reset on many of them) to get them linked up with the new DHCP server. 

I will do my best attempt at that, and report back...

 

UPDATE: (after renewing leases, etc)

Well, some hosts were setup manually (because I was leary of not being able to get to them easily on an earlier attempt with using the USG for DHCP). So, I changed them to DHCP clients. Others were DHCP clients already, and I released/renewed them. 

With my Windows, Mac, and Linux hosts, it seems like they all registered with the USG, and I can get to them via hostname now. 

However, still not so with some other hosts; namely, my UniFi devices (US-8-150W, UAP-AC-LR, UAP-AC-IW, UAP-AC-IW-PRO, and UVC-G3-DOME), and my VMware vSphere ESXi servers. There may be other hosts that I can't get to via hostname, but those are the main ones I've tested with so far.

 

RESOLUTION/WORKAROUND: 
OK....I installed BIND (and Webmin) on the VM that's running the Controller and DVR.
Then I created a zone, added host entries, and I'm off and running.  BAM!! 
10 minutes, and DONE!  :-) 

I promise, in light of how freakin cool (and rock solid) everything else here seems to be so far, I won't be a UniFi hater for this, but wow....this really needs to be taken care of ASAP. 

I suspect the simple, digital watch I had when I was a little kid could probably run this service. 
Why has it been so difficult for Ubiquiti to get this added to the UniFi ecosystem so far?

 


Accepted Solutions
Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?

[ Edited ]

RESOLUTION/WORKAROUND: 
OK....I installed BIND (and Webmin) on the VM that's running the Controller and DVR.
Then I created a zone, added host entries, and I'm off and running.  BAM!! 
10 minutes, and DONE!  :-) 

I promise, in light of how freakin cool (and rock solid) everything else here seems to be so far, I won't be a UniFi hater for this, but wow....this really needs to be taken care of ASAP. 

I suspect the simple, digital watch I had when I was a little kid could probably run this service. 
Why has it been so difficult for Ubiquiti to get this added to the UniFi ecosystem so far?

 

View solution in original post


All Replies
New Member
Posts: 19
Registered: ‎01-31-2016
Kudos: 4

Re: What is Your Solution for Local Name Resolution?

Run a DNS server on the same VM instance as the controller. Use the correct DHCP option to point clients to that’s DNS server

Established Member
Posts: 1,218
Registered: ‎03-31-2017
Kudos: 390
Solutions: 132

Re: What is Your Solution for Local Name Resolution?

What firmware and controller versions are you using?

Make sure you have this "Register client hostname from DHCP requests in USG DNS forwarder" enabled. It can be found in the "Services" (left hand menu on the controller) under "DHCP"
Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?


@robbieduncan wrote:

Run a DNS server on the same VM instance as the controller. Use the correct DHCP option to point clients to that’s DNS server


 

 

OK, ya I was thinking of that. I may indeed do just that. 
Thanks. I just wasn't sure if there is a way of getting UniFi to do this, or not. 

 

 


@TCOA wrote:
What firmware and controller versions are you using?

Make sure you have this "Register client hostname from DHCP requests in USG DNS forwarder" enabled. It can be found in the "Services" (left hand menu on the controller) under "DHCP"

 

USG: 4.4.22.5086045

CONTROLLER VERSION
UI: 5.7.23.0
Backend: 5.7.23
Build: atag_5.7.23_10670
 
Ya, I do already have that feature turned ON, but it doesn't appear to actually do anything. 
Well....perhaps a couple hosts (out of many tens of computers, and other devices of all kinds) respond when I ping them, but I can't tell if that's as a result of name resolution assistance from the USG, or something else. 

e.g. I just did a quick check for the purpose of this post...three computers....pinged them by hostname only.....one responded, the other two did not (i.e. because there was no name resolution for them). 

Another goofy thing is the fact that I have a 'Client' entry in the UniFi configs for every single host on my network, but most of them don't respond, and/or can't be accessed via hostname (including my UniFi controller....i.e. while I have my USG configured to be the DHCP server, I can only get to my UniFi Controller via IP address).  :/ 
Established Member
Posts: 1,218
Registered: ‎03-31-2017
Kudos: 390
Solutions: 132

Re: What is Your Solution for Local Name Resolution?

Are you using DNSMASQ as the DHCP server? I think I remember reading about DNSMASQ registering the MAC address instead of the hostname.

I am running the same firmware on my USG using DHCPD (default), with the beta controller (should have no difference in operation) and my local resolution is working.
Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?

[ Edited ]

@TCOA wrote:
Are you using DNSMASQ as the DHCP server? I think I remember reading about DNSMASQ registering the MAC address instead of the hostname.

I am running the same firmware on my USG using DHCPD (default), with the beta controller (should have no difference in operation) and my local resolution is working.


When I have the USG acting as DHCP server, I'm just running it the default way as it can be configured from within the UniFi Controller GUI, with no customizations or modifications. 

 

EDIT: 

I just noticed that, when I do an ipconfig /release /renew on my Windows hosts, once they've reregistered with the USG's DHCP server, it seems like their IP/Name mappings are added to its list, and local name resolution works for them. 

 

Perhaps since all of the DHCP clients on the network have a very long lease time (bad idea I guess), they're all using settings given to them from the old Wi-Fi router, and never 'check in' with the USG's DHCP server in order for them to be registered there. 

So, I guess I may just need to go around and do that (release/renew DHCP lease) for all hosts on the network (which may require a complete TCP/IP reset on many of them) to get them linked up with the new DHCP server. 

I will do my best attempt at that, and report back...

Established Member
Posts: 1,218
Registered: ‎03-31-2017
Kudos: 390
Solutions: 132

Re: What is Your Solution for Local Name Resolution?

[ Edited ]

ok, the DNSMASQ as DHCP is a new switch that will be in the same place as the "register client hostnames" one. I couldn't remember if it is there in 5.7.

Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?


@TCOA wrote:

ok, the DNSMASQ as DHCP is a new switch that will be in the same place as the "register client hostnames" one. I couldn't remember if it is there in 5.7.


So, will that option make possible what I'm looking for here in this thread? 
If so, and if it's in the beta, perhaps I should bump up to that (I'm in the beta group, but haven't actually fully jumped in yet).

Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?

UPDATE: (after renewing leases, etc)

Well, some hosts were setup manually (because I was leary of not being able to get to them easily on an earlier attempt with using the USG for DHCP). So, I changed them to DHCP clients. Others were DHCP clients already, and I released/renewed them. 

With my Windows, Mac, and Linux hosts, it seems like they all registered with the USG, and I can get to them via hostname now. 

However, still not so with some other hosts; namely, my UniFi devices (US-8-150W, UAP-AC-LR, UAP-AC-IW, UAP-AC-IW-PRO, and UVC-G3-DOME), and my VMware vSphere ESXi servers. There may be other hosts that I can't get to via hostname, but those are the main ones I've tested with so far.

New Member
Posts: 7
Registered: ‎03-20-2018

Re: What is Your Solution for Local Name Resolution?

[ Edited ]

There's some other threads on this issue, which have had handy solutions that got everything working for me.

 

1. Make sure you have a name in the 'Domain' paramters for each network in the controller. I use 'localdomain'.

 

2. Make sare the networks are set to point to the USG as the DNS Server. I just left that option set to auto. If you set the DNS server to an outside server, you won't be able to resolve the hostnames. Set the WAN port on the USG to then point to your preferred DNS server.

 

3. If you're confident with CLI, SSH into the USG and run:

 

sudo /etc/init.d/dnsmasq force-reload

 This will rebuild the DNS name resolver in the USG.

 

4. To see if the USG is actually resolving names properly, in Windows you can run

 

nslookup *inserthostname*

. The output of that should then show the IP address of the device.

 

5. You can also try flushing the DNS Cache in Windows with

 

ipconfig /flushdns

 

I'm not an expert but these settings have worked for me so I hope they help.

Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?


@gricelegal wrote:

There's some other threads on this issue, which have had handy solutions that got everything working for me.

 

1. Make sure you have a name in the 'Domain' paramters for each network in the controller. I use 'localdomain'.

 

2. Make sare the networks are set to point to the USG as the DNS Server. I just left that option set to auto. If you set the DNS server to an outside server, you won't be able to resolve the hostnames. Set the WAN port on the USG to then point to your preferred DNS server.

 

3. If you're confident with CLI, SSH into the USG and run:

 

sudo /etc/init.d/dnsmasq force-reload

 This will rebuild the DNS name resolver in the USG.

 

4. To see if the USG is actually resolving names properly, in Windows you can run

 

nslookup *inserthostname*

. The output of that should then show the IP address of the device.

 

5. You can also try flushing the DNS Cache in Windows with

 

ipconfig /flushdns

 

I'm not an expert but these settings have worked for me so I hope they help.


Thanks. 
I'm squared away with most of that already, but as for the dnsmasq command, what if I'm not yet using dnsmasq, and still just using the default DHCP server? 

New Member
Posts: 7
Registered: ‎03-20-2018

Re: What is Your Solution for Local Name Resolution?

My understanding is that DNS Masq is the service that the USG uses to run DNS when it is running DHCP. If everything is relying on the USG for DHCP and DNS, that command will flush the USG's DNS cache and rebuild it.

 

I found this thread really useful when I had issues with my hostnames. They now all work fine except for my Synology NAS but I beleive that is a problem with Synolody at the moment.

 

https://community.ubnt.com/t5/UniFi-Routing-Switching/UniFi-USG-local-DNS-not-resolving-local-hostna...

 

 

Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: What is Your Solution for Local Name Resolution?

[ Edited ]

RESOLUTION/WORKAROUND: 
OK....I installed BIND (and Webmin) on the VM that's running the Controller and DVR.
Then I created a zone, added host entries, and I'm off and running.  BAM!! 
10 minutes, and DONE!  :-) 

I promise, in light of how freakin cool (and rock solid) everything else here seems to be so far, I won't be a UniFi hater for this, but wow....this really needs to be taken care of ASAP. 

I suspect the simple, digital watch I had when I was a little kid could probably run this service. 
Why has it been so difficult for Ubiquiti to get this added to the UniFi ecosystem so far?

 

Member
Posts: 230
Registered: ‎05-24-2017
Kudos: 74
Solutions: 6

Re: WORKED-AROUND: What is Your Solution for Local Name Resolution?

My solution is noted in a post I think you replied to also here:

 

https://community.ubnt.com/t5/UniFi-Routing-Switching/Static-DNS-entries-and-unqualified-name-resolu...

 

No need to run a DNS server with this -- the USG does the static entries.

 

For example I wanted my printer to be reachable via fully qualified and unqualified name queries.  I test on a windows 10 box and linux and it all appears to work as it should.  Configure the printer to IP print to it by unqualified name and it works.  What's nice about this is I can change the IP address of the printer and never worry about having to re-do each windows or linux box that prints to it by addressing it by the DNS name.

 

I also run a Samba server for files in the house.  That works great too -- wife never complains about not being able to get to the server.  I access it from windows or linux by name -- never need to worry about IP addresses.

 

I also have my gateway and cloudkey convenience names in there.  I've even got an SSL signed cert for my cloud key and I have a fully qualified DNS name pointing to it's internal IP addrses and I enjoy the green lock w/ no cert warnings when using the GUI for my cloud key.

 

Good luck.

 

Emerging Member
Posts: 59
Registered: ‎03-21-2018
Kudos: 9
Solutions: 4

Re: WORKED-AROUND: What is Your Solution for Local Name Resolution?

Nice solution. Thanks for sharing. 
Unfortunately, it won't work for me, because it still suffers from the same problem.....that it uses whatever willy-nilly hostname is given by the DHCP client, and I need to be able to address them by hostnames that make sense to humans. 

Oh well. My BIND DNS server as a workaround will be OK for now until some day when they get this functionality baked-in. 

Member
Posts: 230
Registered: ‎05-24-2017
Kudos: 74
Solutions: 6

Re: WORKED-AROUND: What is Your Solution for Local Name Resolution?

As I mentioned, the JSON file of statics is unrelated to DHCP.

Also assumes the clients aren't using DHCP -- set manually as statics.

 

It works!  As I mentioned in my other post.

 

Only negative part is you can't do this from the GUI.  You have to use a config.gateway.json to add config to the edgerouter part of the gateway that is not configurable via GUI.

 

It implements that static-mapping commands avialable in edge router GUI.

 

And since it's done w/ the JSON file, it's permanent and kept across reboots / re-provisions.

 

In the future when you upgrade, if they come out with GUI to set static DNS mappings, simply remove your config.gateway.json and use whatever new GUI they provide to add your static DNS entries.

 

Good luck!

 

Reply