Article General May 14, 2026 2 min read

Public or Open DNS Server Setup

Calder Pike

Technical Writer

May 14, 2026
2 min read

Setting up a DNS server can feel like a win until your firewall blocks everyone out. By default, Ubuntu’s Uncomplicated Firewall (UFW) shuts down external requests. To get your DNS server up and running for the world, you need to open port 53. But here is the catch: you cannot just open UDP and call it a day.

Why You Need Both UDP and TCP

Most standard DNS queries use UDP because it is fast. However, when a response is too large, or during zone transfers, DNS automatically switches to TCP. If you only open UDP, your server will seem broken or slow to many users. You must open both.

The Universal UFW Commands

Open your terminal and run these two commands. This tells UFW to let global traffic through on port 53 for both protocols:

sudo ufw allow 53/udp
sudo ufw allow 53/tcp

Make the Changes Live

UFW keeps running old rules until you tell it to refresh. Reload the firewall configuration to apply your new rules immediately:

sudo ufw reload

Double-Check Your Work

Never assume a firewall rule worked just because the terminal didn’t error out. Verify the active rules with this command:

sudo ufw status verbose

Look for lines showing 53/udp and 53/tcp marked as “ALLOW IN” from “Anywhere”. If you see them, your DNS server is officially open for business.

Leave a Reply

Your email address will not be published. Required fields are marked *