Skip to content

How to set DNS server

This page shows you how to choose the DNS server that your HiddifyManager server uses, and how to check that DNS works. You need it if sites don't open through your proxy, or if a DNS leak test shows the wrong DNS servers.

DNS (Domain Name System) turns names into IP addresses. For example, when you open google.com, your device first asks a DNS server "what is the IP of google.com?". The DNS server answers with the IP address, and only then does your device connect to the site.

How a DNS request turns a name into an IP address

Your server needs a working, trusted DNS server, just like your phone or computer.

Well-known public DNS servers

Big companies run free DNS servers that work worldwide. These are good choices for your server:

Address Provider
1.1.1.1 Cloudflare
8.8.8.8 Google

Symptoms of a DNS problem on the server

  • Sites don't open through the proxy, or open very slowly, while the connection itself works.
  • The installer or an update shows the warning DNS is not working.
  • A DNS leak test shows DNS servers you didn't choose.

The fix is one or both of the methods below.

Method 1: set the DNS server in the panel

The panel's DNS Server setting is the DNS server that the server and its proxies use to look up sites for your users. When you change it, the server's own system DNS changes with it. The default is 1.1.1.1 (Cloudflare).

  1. Log in to your HiddifyManager admin panel.
  2. In the sidebar, under Settings, click Settings.
  3. DNS Server is an advanced setting, so turn on the Show Advanced Settings switch at the top of the page. Then type DNS Server in the search box (Search all settings…). The setting is the first row of the General Settings card, with the Advanced label.
  4. Open the DNS Server list and pick a public DNS, for example Cloudflare 1.1.1.1. To use a DNS server that is not in the list, choose Custom and enter its address.
  5. Click Save.
  6. When the panel asks, click Apply Configs so the change takes effect.

The DNS Server field in General Settings

Method 2: set the server's own DNS over SSH

The server's operating system also uses a DNS server, for example to download updates. On Ubuntu, HiddifyManager uses the systemd-resolved service for this. Method 1 already changes it, but if the server's DNS doesn't work (for example, you can't open the panel), set it with the script that comes with HiddifyManager (the installer uses the same script).

  1. Connect to your server over SSH. If the HiddifyManager menu opens, press Ctrl+C to leave it.
  2. Run this command on your server. It sets the DNS servers to 8.8.8.8 and 1.1.1.1:

    sudo /opt/hiddify-manager/scripts/common/change_dns.py 8.8.8.8 1.1.1.1
    
  3. When it finishes, the last line should say DNS servers set to 8.8.8.8 and 1.1.1.1.

Don't delete or lock /etc/resolv.conf

Older guides told you to delete /etc/resolv.conf, write it by hand, and lock it with chattr +i. Don't do this on a current HiddifyManager server. On Ubuntu this file is managed by systemd-resolved, and locking it can stop HiddifyManager's installer from repairing DNS. If you locked it before, unlock it with sudo chattr -i /etc/resolv.conf.

Check DNS on the server

Run these commands on your server, over SSH.

  1. Check which DNS servers the system uses:

    resolvectl status
    

    Look for the line DNS Servers. It should list only the servers you chose, for example 8.8.8.8 1.1.1.1.

  2. Check that a name can be resolved:

    nslookup google.com
    

    If it works, you see one or more Address: lines with Google's IP addresses. The Server: line may show 127.0.0.53. That is normal: it is the local systemd-resolved service, which forwards the request to the servers from step 1. If you see an error such as connection timed out or server can't find, DNS doesn't work: repeat Method 2.

    (If nslookup is missing, install it with sudo apt install dnsutils.)

Example output of nslookup google.com

Learn more about DNS leaks


Last update: November 14, 2026

Comments