TRENDING
  • Linux
  • Shell Script
  • Cloud
  • DevOps
  • About US
SUBSCRIBE
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Reading: How to configure Dynamic DNS Server on AlmaLinux / Rocky Linux
Share
TechBrownTechBrown
Aa
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Search
  • CLOUD
  • DEVOPS
  • LINUX
  • SHELL SCRIPT
Follow US
© 2014 - 2022 TechBrown. All Rights Reserved.
Linux

How to configure Dynamic DNS Server on AlmaLinux / Rocky Linux

January 19, 2015
Share
6 Min Read
SHARE
Contents
Host FileHostname ResolutionHost File ConfigurationDomain Name System (DNS)Dynamic DNSDNS NamespaceHow DNS works ?ZoneForward Lookup Zone Reverse Lookup ZoneRecordsSOA RecordNS RecordA RecordCNAME RecordPTR RecordMX RecordDNS Quick SnapshotsPackagesPort numberConfiguration filesDaemonDNS ConfigurationStep-1 (Installing DNS)Step-2 (Configuration of named.rfc1912.zones)Step-3 (Configuration – Forward Lookup Zone)Step-4 (Configuration – Reverse Lookup Zone)Step-5 (Configuration of DNS Server IP Address)Step-6 (Restart the Services)Step-7 (Configuration of DNS Server IP Address)Step-8 (Checking the Configuration)Step-9 (Configuration of named.rfc1912.zones)Step-10 (Restart the Services)Step-11 (Configuration file for ddclient)Step-12 (Check the updates)

The DNS Server stands for Domain Naming System. The Dynamic means which the server configured with the DNS server. The name servers are dynamically updated with the DNS server. Where’s all the DNS records are added to the DNS server. In this tutorial we will describe about the given guide in a step by step manner on AlmaLinux / Rocky Linux / Amazon Linux.

Host File

  • The host file provides resolution of hostname to IP addresses.
  • Only resolve names provide in the local host file.
  • Cannot be used as a centralized database.
  • The hostname and IP address mapping is given in /etc/hosts

Hostname Resolution

Hostname-Resolution

Host File Configuration

Edit the configuration file

# vi /etc/hosts

Add the entries required

127.0.0.1 localhost.localdomain localhost
192.168.0.253 dns.example.com dns
192.168.0.1 client1.example.com client1
192.168.0.2 client2.example.com client2

:wq!

Domain Name System (DNS)

  • The Domain Name System (DNS) is a hierarchical naming system where each level of name is separated by a “.”.
  • Resolves user friendly domain names into computer friendly IP addresses.
  • Also resolves IP addresses into domain names.
  • Provides a centralized database for resolution.

Dynamic DNS

  • Dynamic DDNS
  • DNS is configured with DHCP in such a way that ip & FQDN automatically gets updated over DNS forward & Reverse zone files.
  • Zone journal files are automatically create in Database of DNS with extensions .jnl

DNS Namespace

DNS-Namespace

How DNS works ?

How-DNS-Works

Zone

Zone is a storage database which contains all the records.There are two zones:

Forward Lookup Zone
  • Used for resolving hostnames to IP address.
  • It maintains host to IP address mapping information.
 Reverse Lookup Zone
  • Used for resolving IP address to hostnames.
  • It maintains IP address to hostname mapping information.

Records

SOA Record
  • Start of Authority
  • It is the first record in any zone file.
NS Record
  • Name Server
  • Identifies the DNS server for each zone.
A Record
  • Address
  • Maps a hostname to an IP address.
CNAME Record
  • Canonical Name (Alias)
  • Maps an alias name to a hostname
PTR Record
  • Pointer
  • Maps an IP address to a hostname.
MX Record
  • Mail Exchange
  • Maps a domain name to a mail server.

DNS Quick Snapshots

Packages
  • bind*
  • caching nameserver*.rpm
  • Dhcp*
Port number
  • 53 for DNS
  • 67, 68 for DHCP
Configuration files
  • /etc/named.conf
Daemon
  • named

DNS Configuration

Step-1 (Installing DNS)
# yum install bind* caching* dhcp*
Step-2 (Configuration of named.rfc1912.zones)

Edit the configuration file

# vi /etc/named.conf

To add the options

controls {
inet 127.0.0.1 port 953
allow {127.0.0.1;} keys {"rndckey";};
};
zone "example.com" IN {
type master;
file “example.for";
allow?update { key rndckey; } ;
};
zone "0.168.192.in?addr.arpa" IN {
type master;
file “example.rev";
allow-update { key rndckey; } ;
};

:wq

Step-3 (Configuration – Forward Lookup Zone)

Copy the forward lookup zone file

# cd /var/named/chroot/var/named/
# cp vp localhost.zone example.for

Note: The file has to be copied with the permission

Configuration – Reverse Lookup Zone

Edit the file example.rev

# vi example.rev

To add the options

$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expire
1D) ; minimum
IN NS @
IN A 192.168.0.253
client1 IN A 192.168.0.1
client2 IN A 192.168.0.2
Step-4 (Configuration – Reverse Lookup Zone)

Copy the reverse lookup zone file

# cd /var/named/chroot/var/named/
# cp vp named.local example.rev

Note: The file has to be copied with the permission

Configuration – Reverse Lookup Zone

Edit the file example.rev

# vi example.rev

To add the options

$TTL 86400
@ IN SOA dns.example.com. root.example.com.(
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400) ; Minimum
IN NS dns.example.com.
253 IN PTR dns.
1 IN PTR client1.
2 IN PTR client2
Step-5 (Configuration of DNS Server IP Address)

Edit the configuration file

# vi /etc/resolv.conf

Add the following options

nameserver 192.168.0.253
Step-6 (Restart the Services)

Restart the DNS services

# service named restart
Step-7 (Configuration of DNS Server IP Address)

Edit the configuration file

# vi /etc/resolv.conf

Add the following options

nameserver 192.168.0.253
Step-8 (Checking the Configuration)

Checking forward lookup

# dig dns.example.com
# dig client2.example.com

Checking reverse lookup

# dig vx 192.168.0.2
# dig vx 192.168.0.253

Mount the remote file system

# ping dns.example.com
# ping client2.example.com
Step-9 (Configuration of named.rfc1912.zones)

Edit the configuration file

# vi /etc/dhcpd.conf

To add the options

include "/etc/rndc.key";
ddns-domain “example.com";
ddns-update-style interim;
ddns-rev-domain "0.168.192.in-addr.arpa";
ddns-updates on; allow Dynamic DNS
authoritative;
#master server for this domain
# Allow only the DHCP server to update DNS
ignore client-updates;
allow unknown-clients;zone 0.168.192.in-addr.arpa.
{
primary 192.168.0.252;
key "rndckey";
}
zone techbrown.com. {
primary 192.168.0.252;
key "rndckey";
}
range 192.168.0.20 192.168.0.59;
:wq(save and quit)
Step-10 (Restart the Services)

Restart the DHCP services

# service dhcpd restart
Step-11 (Configuration file for ddclient)
# yum install ddclient*
# vi /etc/ddclient.conf
pid=/var/run/ddclient.pid
protocol=easydns
use=if, if=eth0
server=dns.example.com
# dhclient -r
# dhclient
Step-12 (Check the updates)

Now go to forward/reverse zone file and check the updates

Congratulations now you have configured Dynamic DNS server on AlmaLinux / Rocky Linux / Amazon Linux.

You Might Also Like

How to Optimize MySQL Performance on AlmaLinux / Rocky Linux

How to Enable TLS 1.3 on Apache and Nginx

5 Security Tips to Protect your WordPress Website from Hackers

How to Enable AES-128 Bit SSL Cipher with TLS 1.3 on Nginx Web Server

How to Set Up NGINX Web Server on AlmaLinux / Rocky Linux

Sign Up For Newsletter

Be keep up! Get the latest articles delivered straight to your inbox.

TechBrown Solutions January 19, 2015
Share this Article
Facebook TwitterEmail Print
Share
Leave a comment Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

TRENDING

Linux

How to Install Bitdefender Antivirus Scanner on Ubuntu / Debian

Linux

How to Mount NTFS File System on AlmaLinux / Rocky Linux

Linux

How to Download Instagram Full Size Images on Ubuntu / AlmaLinux / Rocky Linux

Linux

How to Reset Forgotten Root Password on AlmaLinux / Rocky Linux

You Might Also Like

Linux

How to Optimize MySQL Performance on AlmaLinux / Rocky Linux

October 19, 2021
Linux

How to Enable TLS 1.3 on Apache and Nginx

March 14, 2021
Linux

5 Security Tips to Protect your WordPress Website from Hackers

November 8, 2020
Linux

How to Enable AES-128 Bit SSL Cipher with TLS 1.3 on Nginx Web Server

November 7, 2020

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!

Follow US on Social Media

Facebook Twitter Youtube Rss

© 2014 - 2022 Techbrown. All Rights Reserved.

  • About Us
  • Terms of Service
  • Cookie Policy
  • Privacy Policy
By using this site, you agree to the Privacy Policy, Cookie Policy and Terms of Service.
Accept

Removed from reading list

Undo
AdBlock Detected
Our site is an advertising supported site. Please whitelist to support our site.
Okay, I'll Whitelist
Welcome Back!

Sign in to your account

Lost your password?