How to Create CoreDNS in Linux

[root@example ~]#   wget https://github.com/coredns/coredns/releases/download/v1.11.1/coredns_1.11.1_linux_amd64.tgz


[root@example ~]#  tar -xvf coredns_1.11.1_linux_amd64.tgz

[root@example ~]#  mkdir /opt/CoreDNS

[root@example ~]#  mv coredns /opt/CoreDNS

[root@example ~]#  cd /opt/CoreDNS

[root@example CoreDNS ]#  vim  corefile

 raju.com {
         file db.raju.com
     }

rajeev.com {
      file db.rajeev.com
}

[root@example CoreDNS ]#  vim  db.raju.com

$ORIGIN raju.com.
@    3600  IN SOA ns1.raju.com. root.raju.com. (
                                2017042745 ; serial
                                7200       ; refresh (2 hours)
                                3600       ; retry (1 hour)
                                1209600    ; expire (2 weeks)
                                3600       ; minimum (1 hour)
                                )

3600      IN NS   ns1.raju.com.
@          IN A     192.168.122.90
host1     IN A     192.168.122.91
ns1        IN A     192.168.122.90

[root@example CoreDNS ]#   vim  db.rajeev.com

$ORIGIN rajeev.com.
@    3600    IN SOA ns1.rajeev.com. root.rajeev.com. (
                                2017042745 ; serial
                                7200       ; refresh (2 hours)
                                3600       ; retry (1 hour)
                                1209600    ; expire (2 weeks)
                                3600       ; minimum (1 hour)
                                )

3600        IN NS   ns1.rajeev.com.
@            IN A     192.168.122.100
host2       IN A     192.168.122.101
ns1          IN A     192.168.122.100

[root@example CoreDNS ]#  nohup ./coredns -conf corefile &

[root@example CoreDNS ]#  vim /etc/resolv.conf
nameserver  127.0.0.1

[root@example CoreDNS ]#  nslookup raju.com
Server:  127.0.0.1
Address: 127.0.0.1#53

Name: raju.com
Address: 192.168.122.90

[root@example CoreDNS ]#  nslookup host1.raju.com
Server:  127.0.0.1
Address: 127.0.0.1#53

Name: host.raju.com
Address: 192.168.122.91



Comments

Popular posts from this blog

How to install and configure node js and PM2 in rhel7

PCS Corosync Pacemaker Cluster Mariadb using NFS

How to Create or Configure iSCSI Server and Clinet