Here are some FAQs we gathered concerning setting up DNS for UnifFi.
DNS is not directly related to your internet speed. However, it helps you establish connections faster. So, properly setting it up is important.
Below are some FAQs and tutorials on how to set up DNS for your UniFi.
How to setup DNS for Unifi Security Gateway
There are two places where you can set the DNS servers for the USG. They are as follows:
- Devices > [select USG] > Config > WAN > Preferred/Alternate DNS
- Settings > Networks > [click Edit] > DHCP Name Server (Manual)
The first one is the setting for the router that decides what DNS it uses itself. On the other hand, the second one is the DNS settings your USG hands out to the clients on the network getting their addresses from DHCP.
If you want to set your devices to use OpenDNS, specify the server using the first method. You can also set the latter to use OpenDNS, but it does not need to be. In fact, putting the DNS IP on both settings is not recommended as the second setting overwrites the first setting.
How to change DNS settings in USG?
Go to Settings > Networks > LAN. Then, change the DNS there. This will assign your set DNS to all of your DHCP LAN clients.
You can also change the DNS through Settings > Networks > WAN. However, you may need to do something else after that to get it working, so it is not really recommended.
How to find what DNS servers I’m using for Unifi?
You can use the CMD on the Windows client. Enter the command ‘ipconfig /all.’ Then, scroll down and find DNS servers; you can see which DNS server you are using there.
Also, you can SSH into the USG and enter the command ‘show dns forwarding nameservers’ to see what DNS server is currently set.
If that does not work, try either of these two commands:
show configuration commands | grep name-server
show configuration commands | grep dns-server
If all of these return 18.104.22.168, the server is the USG. But if it is another IP, like 192.168.1.1, then your ISP is responsible for handling DNS settings to the USG.
Troubleshooting common errors in DNS setup for Unifi
Here are some errors in the DNS setup for Unifi and how to resolve these issues.
1. How to fix DNS no longer working after UniFi updated to 5.8.23?
You may be using an internal DNS server on your network, and it works without problems. However, after updating to 5.8.23, it may stop working properly. You may have to add the external DNS Servers (22.214.171.124 and 126.96.36.199) into the DNS Server 2 & DNS Server 3 fields to make it work again.
Alternatively, you can try restarting the controller and the USG. Check if the issue got fixed.
If not – and assuming you use Docker and can shift versions – you can try reverting back to 5.7.23. Then go back to 5.8.23 and install everything again. It should be working now.
2. How to fix the IPv4 address not updating in USG DNS?
When adding a USG to your network, you can switch your devices to DHCP and move them to a new IP range before the change to avoid issues with DHCP and DNS.
After migration, you need to reinstate the fixed IP addresses for your devices.
The USG, however, may fail to serve the right IP address to your NAS but serve the right IP addresses to other devices. Even manually setting the IP address on your NAS may not solve the problem.
To fix this issue:
- Set the IP configuration as static in the Unifi console.
- Switch the network interfaces on the NAS to DHCP.
- Wait for the lease to be issued and then switch the NAS back to static IP.
The issue should be resolved.
3. How to fix UniFi LTE failing to resolve DNS on networks with an active Content Filter?
When using the DNS content filter for a network, the DNS resolution during active LTE failover may fail for these networks.
A workaround to this is creating a dummy network – type Corporate – with CIDR 203.0.113.1/24. However, this workaround is not persistent; it will not survive a reboot. Furthermore, it causes further problems when changing any content filter settings afterward.
This issue is actually a bug. You can solve the problem by updating to Unifi Network (Controller) 6.4.50 Beta or onwards.
Why do UniFi devices communicate with public DNS servers?
The following UniFi devices are performing the queries:
Ubiquiti has not yet made a comment on this. So it is possible the company is using the queries for its own benefit. But that’s only speculation.