Docs / DNS & Domains / How to Set Up BIND DNS Server

How to Set Up BIND DNS Server

By Admin · Feb 25, 2026 · Updated Apr 23, 2026 · 91 views · 1 min read

Run your own authoritative DNS server with BIND.

Install

apt install bind9 bind9-utils -y

Configure a Zone

Edit /etc/bind/named.conf.local:

zone "example.com" {\n    type master;\n    file "/etc/bind/db.example.com";\n};

Create Zone File

Create /etc/bind/db.example.com:

$TTL 86400\n@   IN  SOA ns1.example.com. admin.example.com. (\n        2024010101 ; Serial\n        3600       ; Refresh\n        1800       ; Retry\n        604800     ; Expire\n        86400 )    ; Minimum TTL\n\n@   IN  NS  ns1.example.com.\n@   IN  A   198.48.63.241\nwww IN  A   198.48.63.241

Restart

named-checkconf\nnamed-checkzone example.com /etc/bind/db.example.com\nsystemctl restart bind9

Was this article helpful?