Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Deploying BIND DNS for Bidirectional Lookup Resolution

Tech May 9 3

Enviromnent Preparation

Before configuring the name service, ensure the underlying operating system is ready. Disable firewalls and SELinux temporarily to avoid interference during setup.

# Stop firewall service
dsystemctl stop firewalld

# Set SELinux to permissive mode
setenforce 0

# Install BIND package
dnf install bind -y

Verify the installation by listing installed packages:

[root@server ~]# rpm -qa | grep bind
bind-export-devel-9.11.x.x86_64
bind-sdb-chroot-9.11.x.x86_64
... (output list)

Implementing Forward Lookups

Edit the main configuration file at /etc/named.conf to define listening parameters and zone types.

options {
        listen-on port 53 { 192.168.100.10; };
        directory       "/var/named";
        allow-transfer     { any; };
};

zone "corpnet.local" IN {
        type master;
        file "forward.zone";
};

Next, create the forward zone defiintion file within /var/named/.

$TTL 1D
@       IN SOA  @ root.corpnet.local. (
                2024010100      ; Serial number
                2D              ; Refresh time
                4H              ; Retry time
                1D              ; Expire time
                1D )            ; Minimum TTL
        IN NS   ns1.corpnet.local.
nsserver    IN A    192.168.100.10
www         IN A    192.168.100.10
api         IN A    192.168.100.10
portal      IN CNAME www

Apply the changes and restart the daemon:

systemctl restart named

Verification on Client

Point a client machine's resolver settings to the new nameserver IP in /etc/resolv.conf.

nameserver 192.168.100.10
search corpnet.local

Test resolution connectivity:

ping www.corpnet.local
PING www.corpnet.local (192.168.100.10) 56(84) bytes of data.
64 bytes from 192.168.100.10: icmp_seq=1 ttl=64 time=0.4 ms
--- Statistics ---

Implementing Reverse Lookups

To enable pointer (PTR) resolution, add a corresponding reverse zone to the main configuration.

options {
        listen-on port 53 { 192.168.100.10; };
        directory       "/var/named";
        allow-transfer     { any; };
};

zone "corpnet.local" IN {
    type master;
    file "forward.zone";
};

zone "100.168.192.in-addr.arpa" IN {
    type master;
    file "reverse.zone";
};

Create the reverse zone file located at /var/named/reverse.zone.

$TTL 1D
@       IN SOA  @ root.corpnet.local. (
                2024010100
                2D
                4H
                1D
                1D )
        IN NS   ns1.corpnet.local.
10      IN PTR   ns1.corpnet.local.
11      IN PTR   www.corpnet.local.
12      IN PTR   api.corpnet.local.

Ensure the service restarts to load the new zones:

systemctl restart named

The DNS infrastructure now supports both hostname-to-IP and IP-to-hostname translatino for the specified network range.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.