How to Install Bind on Fedora Server Latest?

Bind or Berkeley Internet Name Domain is an open-source DNS server software that provides services for translating domain names into IP addresses. It is widely used as a primary DNS server on the Internet. In this tutorial, we will guide you through the process of installing Bind on Fedora Server Latest version. So, let's get started.

Prerequisites

Before we begin, make sure that your Fedora Server Latest version is up-to-date by running the following command in your terminal:

sudo dnf update -y

Step 1: Install Bind on Fedora

To install Bind on Fedora Server Latest version, we will use the DNF package manager. Run the following command in your terminal:

sudo dnf install -y bind bind-utils

This command will install Bind along with some utilities that will help us to configure and manage the DNS server.

Step 2: Configure Bind

After the installation is complete, we need to configure Bind to work as a DNS server. The configuration file for Bind is located at /etc/named.conf. You can use your favorite text editor to modify this file. In this tutorial, we will use nano.

Run the following command in your terminal to open the named.conf file:

sudo nano /etc/named.conf

By default, the named.conf file contains a lot of commented out examples. We will use the following configuration:

options {
        listen-on port 53 { 127.0.0.1; };
        listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "example.com" IN {
        type master;
        file "/var/named/example.com.db";
        allow-update { none; };
};

This configuration defines the following:

  1. Bind will listen on port 53 on the loopback address 127.0.0.1 and IPv6 loopback address ::1.
  2. The directory where Bind will store its data files.
  3. The files where Bind will store statistics and dump data.
  4. Bind will allow DNS queries from the localhost only.
  5. Recursion is enabled.
  6. DNSSEC is enabled and validated.
  7. The root hints file is included.
  8. A zone named example.com is defined as a master zone.

Save and close the file by pressing Ctrl + X, then Y, and then Enter.

Next, we need to create the example.com.db file that defines the DNS records for our domain. Run the following command in your terminal:

sudo nano /var/named/example.com.db

Add the following configuration to the file:

$TTL 86400
@   IN  SOA     ns1.example.com. admin.example.com. (
            2018010101  ; Serial
            3600        ; Refresh
            1800        ; Retry
            604800      ; Expire
            86400       ; Minimum TTL
)

@   IN  NS      ns1.example.com.
@   IN  A       192.168.1.100
ns1 IN  A       192.168.1.100

This configuration defines the following:

  1. The TTL for the zone is set to 86400 seconds.
  2. The Start of Authority (SOA) record defines the primary master DNS server for our domain.
  3. The name server (NS) record points to the primary DNS server for our domain.
  4. An A record that maps the domain name to the IP address of our server.
  5. An A record that defines the IP address for the ns1.example.com subdomain.

Save and close the file by pressing Ctrl + X, then Y, and then Enter.

Step 3: Start and Enable Bind Service

After configuring Bind, we need to start the service and enable it to start at boot time.

Run the following command in your terminal to start the Bind service:

sudo systemctl start named

Use the following command to verify that the service is running:

sudo systemctl status named

If the service is running, you should see the output that confirms it.

Now, we need to enable Bind to start at boot time by using the following command:

sudo systemctl enable named

Step 4: Test Bind Installation

To test if Bind is working correctly, open your favorite web browser and browse to http://192.168.1.100. If the configuration was correct, you should see a default Apache welcome page. This is because we have not configured the web server for our domain yet.

To test your DNS server, run the following command in your terminal:

nslookup example.com

This command will query Bind for the IP address of example.com. If everything is working correctly, you should get the IP address of your server as a response.

That's it! You have successfully installed and configured Bind on Fedora Server Latest version.

Conclusion

In this tutorial, we have covered the steps required to install and configure Bind on Fedora Server Latest version. Now you can use Bind as a primary DNS server to translate domain names into IP addresses. We hope this tutorial was helpful for you!

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!