Setting Up Bind As a Private DNS Server on RHEL 8


Follow these instructions to configure Bind as a private DNS server on RHEL 8. Start by using the package manager to install the Bind package. Then, set the appropriate parameters, including listen-on, forwarders, and zones, in the named.conf file, which is the primary Bind configuration file. For each domain you wish to administer, create zone files and include the relevant records, such as A, CNAME, and NS. Set up the firewall so that DNS traffic is permitted. Start the Bind service and make it so that it launches with the system. Ask the DNS server for domain records to finish testing it. You may successfully set up Bind as a private DNS server on RHEL 8 by following these instructions.

Methods Used

  • Manual Configuration

  • Web-based Administration Tools

Manual Configuration

Direct manipulation of the Bind configuration files is required when configuring Bind as a private DNS server under RHEL.Using a text editor, you must alter the named.conf file located in the /etc/named directory in order to use this method. To modify the DNS server, this file can define options, zones, zone files, and ACLs. Administrators have precise control over the server's behaviour and can tailor it to match their unique needs by manually adjusting these options. Although this method offers flexibility, it might necessitate a greater comprehension of Bind settings and syntax.

Algorithm

  • Install the Bind package  To install the Bind software on the RHEL server, use the package manager.

sudo yum install bind
  • Set up named.conf  Change the configuration of named.conf in the /etc/named directory. Set parameters like listen-on to define the IP addresses and listening ports, forwarders to use an external DNS server, and ACLs to control access.

sudo vi /etc/named.conf
  • Create zone files  For each domain you wish to manage, create zone files. The DNS records for the respective domains are contained in these files. Include in the zone files the relevant record types, such as A, CNAME, NS, etc.

sudo vi /var/named/example.com.zone
  • Configure zone declarations  Include zone declarations for the domains you wish to administer in the named.conf file. Indicate the zone's name, type (such as "master"), and the location of the relevant zone file.

sudo vi /etc/named.conf

Add the following lines to the named.conf file −

zone "example.com" IN {
    type master;
    file "/var/named/example.com.zone";
};
  • Setup firewall  Modify the firewall's configuration to let DNS traffic (port 53) reach the DNS server.

sudo firewall-cmd --zone=public --add-service=dns --permanent
sudo firewall-cmd --reload
  • Start the Bind service using the proper command, such as systemctl start named, to complete step six.

sudo systemctl start named
  • Enable the Bind service  Use the systemctl enable named command to tell the Bind service to launch automatically when the system boots.

sudo systemctl enable named
  • Check the DNS server's functionality by using DNS querying tools like dig or nslookup. Verify that the server replies successfully by requesting the DNS records for the defined domains.

dig example.com

Web-based Administration Tools

Bind can be set up on RHEL as a private DNS server using the user-friendly graphical interface of the web-based administration tools. By enabling administrators to control DNS zones, records, and server settings from a web browser, tools like Webmin and ISPConfig streamline the setup procedure. They make it simpler to add, amend, or delete DNS entries by removing the requirement for manual configuration file editing. Administrators may easily manage DNS management activities including zone transfers, access control, and more with the help of these tools. The configuration and maintenance of Bind as a private DNS server on RHEL is made simpler by the use of web-based administration tools, which provide a visual method.

Algorithm

  • Start

sudo yum install bind
  • Use the package manager to install the Bind package.

sudo nano /etc/named.conf
  • Set the named.conf file in the /etc/named directory to your preferences.

listen-on port 53 { any; };
allow-query { localhost; };
forwarders { 8.8.8.8; };
  • In named.conf, specify the required parameters, such as listen-on, forwarders, and zones.

sudo nano /etc/named/example.com.zone
  • For each domain you wish to administer, create zone files. Include in these files the pertinent DNS records, such as A, CNAME, and NS.

$TTL 86400
@   IN   SOA   ns1.example.com.   admin.example.com. (
                       2021071401   ; Serial
                       3600         ; Refresh
                       1800         ; Retry
                       604800       ; Expire
                       86400        ; Minimum TTL
)
@   IN   NS    ns1.example.com.
@   IN   A     192.168.1.1
  • Set up the firewall to let DNS traffic through.

sudo firewall-cmd --zone=public --add-service=dns --permanent
sudo firewall-cmd --reload
  • Launch the Bind service.

sudo systemctl start named
  • Make the Bind service start up with the system.

sudo systemctl enable named
  • Check the DNS server's functionality by asking for domain records.

nslookup example.com

Conclusion

In conclusion, Bind can be configured manually or with the aid of web-based administration tools to function as a private DNS server on RHEL 8. As part of the manual configuration process, Bind must be installed, named.conf must be modified, zone files must be created, zone declarations must be configured, the firewall must be set up, the Bind service must be started and enabled, and the DNS server must be tested. On the other hand, graphical user interfaces for managing DNS zones, records, and server settings are offered by web-based administration tools like Webmin and ISPConfig. By removing the need for manual configuration file editing, these solutions streamline the installation process. Overall, both techniques present practical means of setting up a private DNS server on RHEL 8.

Updated on: 03-Aug-2023

212 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements