DNS (BIND) Server on CentOS 7

Installing DNS on CentOS7 Vagrant for sending and receiving e-mails on Zimbra

Photo by Riaan Myburgh on Unsplash
config.vm.network “private_network”, ip: “192.168.10.34”
config.vm.network “forwarded_port”, guest: 7306, host: 7306
config.vm.hostname = “zimbra.nils.local”
sudo yum -y install bind bind-utils
sudo yum install nano
sudo nano /etc/named.conf
options {// listen-on port 53 { 127.0.0.1; };// listen-on-v6 port 53 { ::1; };listen-on port 53 { 127.0.0.1; 192.168.10.34; };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";recursing-file  "/var/named/data/named.recursing";secroots-file   "/var/named/data/named.secroots";allow-query     { localhost; 192.168.10.0/24; };
zone "." IN {type hint;file "named.ca";};zone "nils.local" IN {type master;file "/var/named/zimbra.nils.local.db";allow-update { none; };allow-query { any; };};zone "10.168.192.in-addr.arpa" IN {type master;file "/var/named/192.168.10.34.db";allow-update { none; };allow-query { any; };};
sudo nano /var/named/zimbra.nils.local.db
@   IN  SOA     ns1.nils.local. root.nils.local. (1001    ;Serial3H  ;Refresh15M     ;Retry1W  ;Expire1D  ;Minimum TTL);Name Server Information@      IN  NS      ns1.nils.local.;IP address of Name Serverns1 IN  A   192.168.10.34;Mail exchangernils.local. IN  MX 10   zimbra.nils.local.;A - Record HostName To IP Addresswww     IN  A       192.168.10.34zimbra    IN  A       192.168.10.34;CNAME recordftp     IN CNAME        www.nils.local.
sudo nano /var/named/192.168.10.34.db
@   IN  SOA     ns1.nils.local. root.nils.local. (1001    ;Serial3H  ;Refresh15M     ;Retry1W  ;Expire1D  ;Minimum TTL);Name Server Information@ IN  NS      ns1.nils.local.;Reverse lookup for Name Server34        IN  PTR     ns1.nils.local.;PTR Record IP address to HostName100  IN  PTR     www.nils.local.150  IN  PTR     zimbra.nils.local.
sudo systemctl restart named
sudo systemctl enable named
sudo nano /etc/resolv.conf
# Generated by NetworkManagersearch nils.local#nameserver 10.0.2.3nameserver 192.168.10.34
sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"BOOTPROTO="dhcp"ONBOOT="yes"TYPE="Ethernet"PERSISTENT_DHCLIENT="yes"DNS1=192.168.10.34
sudo systemctl restart NetworkManager
dig -t A zimbra.nils.local
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6 <<>> -t A zimbra.nils.local;; global options: +cmd;; Got answer:;; WARNING: .local is reserved for Multicast DNS;; You are currently testing what happens when an mDNS query is leaked to DNS;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19352;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 4096;; QUESTION SECTION:;zimbra.nils.local.     IN  A;; ANSWER SECTION:zimbra.nils.local.  86400   IN  A   192.168.10.34;; AUTHORITY SECTION:nils.local.     86400   IN  NS  ns1.nils.local.;; ADDITIONAL SECTION:ns1.nils.local.     86400   IN  A   192.168.10.34;; Query time: 0 msec;; SERVER: 192.168.10.34#53(192.168.10.34);; WHEN: Tue Nov 03 07:13:14 UTC 2020;; MSG SIZE  rcvd: 96
dig -x 192.168.10.100
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-16.P2.el7_8.6 <<>> -x 192.168.10.100;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52264;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2;; OPT PSEUDOSECTION:; EDNS: version: 0, flags:; udp: 4096;; QUESTION SECTION:;100.10.168.192.in-addr.arpa.   IN  PTR;; ANSWER SECTION:100.10.168.192.in-addr.arpa. 86400 IN   PTR www.nils.local.;; AUTHORITY SECTION:10.168.192.in-addr.arpa. 86400  IN  NS  ns1.nils.local.;; ADDITIONAL SECTION:ns1.nils.local.     86400   IN  A   192.168.10.34;; Query time: 0 msec;; SERVER: 192.168.10.34#53(192.168.10.34);; WHEN: Tue Nov 03 07:14:17 UTC 2020;; MSG SIZE  rcvd: 118

I would love to change the world, but they won’t give me the source code | coding 👩🏼‍💻 | coffee ☕️ | jazz 🎷 | anime 🐲 | books 📚 | drawing 🎨