Few Boundaries, Expandable Box

DNS

This quick guide will guide you on how to use DNS.

Install

named.conf
1yum install bind bind-utils
2vi /etc/named.conf
named.conf
1listen-on port 53 { 127.0.0.1; any; };
2allow-query { localhost; any; };
3zone "fewbox.lan" IN {
4  type master;
5  file "fewbox.lan.zone";
6};
fewbox.lan.zone
1vi /var/named/fewbox.lan.zone
fewbox.lan.zone
1$TTL 1w
2@ IN SOA @ fewbox.lan. (
3  2 ; Serial
4  604800 ; Refresh
5  7200 ; Retry
6  604800 ; Expire
7  300 ; Minimum
8)
9@ IN NS fewbox.lan.
10@ IN A 192.168.1.188
11www IN A 192.168.1.188
12master IN A 192.168.1.111
13worker1 IN A 192.168.1.112
14worker2 IN A 192.168.1.113
15worker3 IN A 192.168.1.114
16worker4 IN A 192.168.1.115
17hybrid IN A 192.168.1.116
18dns IN A 192.168.1.117
19nginx IN A 192.168.1.118
20nfs IN A 192.168.1.119
21registry IN A 192.168.1.119
22vpn IN A 192.168.1.119
23ldap IN A 192.168.1.119
24webdav IN A 192.168.1.119
named-checkzone
1named-checkzone fewbox.lan.zone /var/named/fewbox.lan.zone
named
1systemctl enable named
2systemctl start named
firewall-cmd
1firewall-cmd --add-service=dns --permanent
2firewall-cmd --reload
other
1/etc/named.conf              # bind Main configuration file
2/etc/named.rfc1912.zones     # Define zone file
3/etc/rc.d/init.d/named       # bind script file
4/etc/rndc.conf               # rndc config file
5/usr/sbin/named-checkconf    # Check /etc/named.conf File syntax
6/usr/sbin/named-checkzone    # Check the syntax of the zone and the corresponding zone file.
7/usr/sbin/rndc               # Remote DNS management tool
8/usr/sbin/rndc-confgen       # Generate rndc key
9/var/named/named.ca          # Root resolution library
10/var/named/named.localhost   # Local host resolution library
11/var/named/slaves            # From the ns server folder

Client Setting

ifcfg-enp0s3 (client)
1BOOTPROTO="static"
2IPADDR=192.168.1.111
3NETMASK=255.255.255.0
4GATEWAY=192.168.1.1
5DNS1=192.168.1.117 DNS2=8.8.8.8