[DNS] Ubuntu 14.04 deploy local DNS Service

Keywords: DNS vim kafka Ubuntu

1, Background

In the Intranet environment, you need to install the local DNS service at many times. Take the ubuntu 14.04 64 bit operating system environment as an example to illustrate the DNS server building method.

2, Deployment steps

2.1 install bind software

# apt-get install bind9 -y
2.2 edit profile

A. add a custom domain name resolution field (just copy the configuration of the existing domain name resolution field, including forward and reverse contents)

# vim /etc/bind/named.conf.default-zones
zone "traefik.local" {
        type master;
        file "/etc/bind/db.traefik.local";
};

zone "10.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.192.168.10";
};
b. configure forward resolution (one A record per line, for example, ui.traifik.local corresponds to 192.168.10.125)

# cd /etc/bind/ && cp db.local db.traefik.local
# vim /etc/bind/db.traefik.local
;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     traefik.local. root.traefik.local. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      traefik.local.
@       IN      A       192.168.10.125
ui      IN      A       192.168.10.125
kibana  IN      A       192.168.10.126
kafka   IN      A       192.168.10.127
    c. configure reverse resolution
# cd /etc/bind && cp db.127 db.192.168.10
# vim /etc/bind/db.192.168.10
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     traefik.local. root.traefik.local. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      traefik.local.
125     IN      PTR     ui.traefik.local.
126     IN      PTR     kibana.traefik.local.
127     IN      PTR     kafka.traefik.local.

d. restart the service or reload the configuration (the overloaded configuration will take effect after modification)

# /etc/init.d/bind9 restart
# rndc reload
3, Client configuration

If the client has configured the DNS server address, you can use the domain name to access!









Posted by ramas on Tue, 05 May 2020 18:03:14 -0700