setup dns on unifi security gateway

Setup DNS on UniFi Security Gateway (2023 Guide)

By Laura White
AD

Setting up DNS (Domain Name System) on a UniFi Security Gateway (USG) is a crucial step in managing your network's internet connectivity. DNS translates human-readable domain names to IP addresses, allowing devices to communicate with each other seamlessly. This comprehensive guide will walk you through the process,niethelp for a smooth and secure setup.

Before diving into the steps, ensure that you have the following: a UniFi Security Gateway, a local router, and a stable internet connection. Additionally, you'll need access to the USG's controller interface and basic knowledge of network management.

Understanding DNS Settings on UniFi Security Gateway

The UniFi Security Gateway comes with robust DNS management features, allowing you to configure DNS servers, enable DNS caching, and even set up DNS forwarder policies. Understanding these settings will help streamline your network's internet traffic.

AD
How To: Deploying a Ubiquiti UniFi Home Network including Multiple WiFi Access Points (Part 1) - Free Time
How To: Deploying a Ubiquiti UniFi Home Network including Multiple WiFi Access Points (Part 1) - Free Time
DNS Lookup Explained
DNS Lookup Explained
UniFi Network setup
UniFi Network setup

By default, the USG uses Google's public DNS servers (8.8.8.8 and 8.8.4.4). However, you can change these to use your preferred DNS servers, such as your ISP's DNS servers or a third-party provider like Cloudflare.

Changing Primary and Secondary DNS Servers

Adjusting the primary and secondary DNS servers can improve your network's performance and reliability. Here's how to do it:

Top Free DNS Services to Speed Up & Secure Your Internet in 2026
Top Free DNS Services to Speed Up & Secure Your Internet in 2026
a poster with instructions on how to use the dns fundamentals for windows and mac
a poster with instructions on how to use the dns fundamentals for windows and mac
Smart Home Network Tour: UniFi UDM Pro and Synology NAS
Smart Home Network Tour: UniFi UDM Pro and Synology NAS

1. Log in to the USG controller interface using a web browser.

2. Navigate to the 'Settings' tab and select 'Gateway.'

AD

3. Under the 'DHCP' section, locate the 'DNS Server' field.

Learn how DNS works
Learn how DNS works
2022 Complete Unifi Setup Guide
2022 Complete Unifi Setup Guide
DNS Settings Explained: 2 Quick Changes for Faster, Safer Internet
DNS Settings Explained: 2 Quick Changes for Faster, Safer Internet
there are many different types of electronic equipment on the shelf in front of the table
there are many different types of electronic equipment on the shelf in front of the table
My Homelab Setup
My Homelab Setup
Simplify Operations With Cloud DNS
Simplify Operations With Cloud DNS

4. Replace the default values (8.8.8.8 and 8.8.4.4) with your preferred primary and secondary DNS servers.

5. Click 'Apply' to save the changes. The USG will now use the new DNS servers for all DHCP clients.

AD

Enabling DNS Cache for Improved Performance

Enabling DNS cache on the USG can significantly improve internet performance by reducing latency and minimizing external DNS queries. Here's how to enable it:

Easily Change Your Router’s DNS for Faster Internet
Easily Change Your Router’s DNS for Faster Internet
Best DNS Server for Your Location: Lower Gaming Ping in Minutes
Best DNS Server for Your Location: Lower Gaming Ping in Minutes
Massive UniFi Home Network Upgrade - Part 2: Setup, Configuration and Performance Results
Massive UniFi Home Network Upgrade - Part 2: Setup, Configuration and Performance Results
a diagram showing how to set up an equip router for the internet
a diagram showing how to set up an equip router for the internet
What Is DNS A Simple Guide to How the Internet Finds Websites 🌐
What Is DNS A Simple Guide to How the Internet Finds Websites 🌐
DNS
DNS
Fortinet SDWAN Setup Follow & Subscribe Networks Baseline #education #networking #fyp #fblifestyle #security Computer Basics, Data Center, It Network, Information Technology, Technology, Education
Fortinet SDWAN Setup Follow & Subscribe Networks Baseline #education #networking #fyp #fblifestyle #security Computer Basics, Data Center, It Network, Information Technology, Technology, Education
#systemdesign #coding #interviewtips | Anmol Agarwal
#systemdesign #coding #interviewtips | Anmol Agarwal
the dashboard screen for an app showing different devices and their features, including wifi
the dashboard screen for an app showing different devices and their features, including wifi
How Will DNS Security Enhance The Web?
How Will DNS Security Enhance The Web?
How To: Home Network 4.0 with Ubiquiti Unifi Dream Machine Pro, Switch Pro, Flex Mini, Smart Power Plug & UPS Review & Calibration - Free Time
How To: Home Network 4.0 with Ubiquiti Unifi Dream Machine Pro, Switch Pro, Flex Mini, Smart Power Plug & UPS Review & Calibration - Free Time

1. In the USG controller interface, navigate to the 'Services' tab and select 'DNS.'

2. Under the 'Cache' section, check the 'Enable DNS Cache' checkbox.

AD

3. Configure the desired cache size and timeout values. The default settings usually work well for most networks.

4. Click 'Apply' to enable DNS caching.

Configuring DNS Forwarding Policies

DNS forwarding policies allow you to control how the USG handles DNS requests, enabling you to route specific domains or IP addresses through particular DNS servers. This feature is particularly useful when deploying split-DNS or multifactor authentication solutions.

To configure DNS forwarding policies, follow these steps:

Creating a New DNS Forwarder Policy

1. In the USG controller interface, navigate to the 'Services' tab and select 'DNS.'

2. Under the 'Policy' section, click the '+' icon to create a new policy.

3. Enter a name and description for the policy, then configure the following settings:

  • Domain: Specify the domain that the policy should apply to (e.g., example.com).
  • Server: Specify the DNS server that the USG should use for queries matching the domain.
  • Action: Choose whether to 'Accept' or 'Reject' the DNS request based on the domain and server.

4. Click 'Apply' to create the new policy.

Managing DNS Forwarder Policies

Once you've created one or more DNS forwarding policies, you can view and manage them in the DNS 'Policy' section. Here, you can:

  • Enable or disable policies
  • Edit policy settings
  • Delete policies

Regularly reviewing and adjusting your USG's DNS settings ensures optimal network performance and security. As your network grows and evolves, so too should your DNS management strategies. Stay informed and proactive in maintaining your UniFi Security Gateway for a reliable and efficient network.

AD