UniFi - How to manually set UXG DNS via SSH

Alex Lowe

Last updated: October 9, 2026

Sometimes you might need to log into a UXG via SSH to manually set the DNS server. This might be because of a misconfiguration from the Web GUI or something similar.

If you want fast and reliable UniFi hosting, check out HostiFi with expert support, regular backups, managed updates and prices from $19 per month.

To learn more about our hosting plans, create an account or book a free demo to get started.

How to manually set UXG DNS via SSH

To do this, first log into your UXG via SSH and run the following command, replacing DNS_SERVER with the IP address you would like to use.

echo "nameserver DNSERVER" > /etc/resolv.conf

For example:

echo "nameserver 1.1.1.1" > /etc/resolv.conf

About HostiFi

HostiFi provides hosting for Ubiquiti software platforms, with servers for UniFi and UISP. We also offer network consulting, with HostiFi Professional Services.

Get the Ubiquiti Top 20

Each month our team sifts through Ubiquiti news and content from around the web and delivers 20 of our favorite links to your inbox.

View recent issues

No spam. Unsubscribe anytime.

🤩

Discovered 3+ things that I did not know and will have a material impact on my business.

Newsletter Subscriber

🤩

All the info I want/need in a single clean thread! Perfect!

Newsletter Subscriber

🤩

Providing super valuable information to keep the community in the know. Awesome links page, Thank You.

Newsletter Subscriber