In order for the websites you host on your virtual server (VDS) to open to the world, the domain names must be directed to the server IP address. If you want to use completely corporate name servers belonging to you, such as ns1.yourbrand.com and ns2.yourbrand.com, instead of using the DNS infrastructure of an external company, you must install a DNS service on your server. The most popular and robust DNS service in the Linux world is BIND (Berkeley Internet Name Domain).
1. Installing the BIND Package
Connect to your AlmaLinux or compatible RedHat-based server via SSH with root privileges and install BIND and the necessary tools:
dnf update -y
dnf install bind bind-utils -y
2. Editing the Basic Configuration File
We need to open BIND's main configuration file, /etc/named.conf, and allow your server to listen to incoming DNS queries from the outside:
nano /etc/named.conf
Find these two lines in the file and change them to any;:
listen-on port 53 { 127.0.0.1; any; };
allow-query { localhost; any; };
3. Creating Zone Files
Scroll down to the bottom of the same file and add a Zone record for your domain name:
zone "yourbrand.com" IN {
type master;
file "/var/named/yourbrand.com.db";
allow-update { none; };
};
Then you must create the database file (yourbrand.com.db) you defined in the /var/named/ directory and enter your ns1, ns2, and A records to point to the server IP address.
4. Firewall and Starting the Service
DNS queries are made over port 53 (UDP and TCP). Open this port in your firewall and start the BIND service (named):
After the operations, the global reflection (Propagation) of your DNS records may take 1-24 hours. To strengthen your corporate identity and keep your DNS infrastructure 100% under your control, you can safely apply these configurations on our İyibirNet VDS Server services.