Domain Name System
의 약자로 호스트의 도메인을 호스트의 네트워크 주소로 변환해주는 것
Type | Full Name | Description |
---|---|---|
A | Host Record (IPv4) | FQDN과 32 bit의 IPv4로 연결 |
AAAA | Host Record (IPv6) | FQDN과 128 bit의 IPv6로 연결 |
CNAME | Alias Record (별칭) | 실제 도메인 이름과 연결되는 가상 도메인 이름을 정의 |
SOA | Start Of Authority | 권한 시작을 지정하며, 권한이 있는 서버를 가리킴 |
NS | Name Server | 도메인 서버 목록을 지정 |
MX | Mail Exchange Record | 주어진 사서함에 도달할 수 있는 라우팅 정보를 제공 |
SRV | Service Resources | 비슷한 TCP/IP 서비스를 제공하는 다수의 서버 위치 정보를 제공 |
Forward
apt install -y bind9 bind9-utils bind9-dnsutils
vim /etc/resolv.conf
nameserver 192.168.0.1
vim /etc/bind/named.conf
zone "naver.com"{
type master;
file "naver.zone";
};
vim /etc/bind/named.conf.options
dnssec-validation no;
cp /etc/bind/db.local /var/cache/bind/naver.zone
vim /var/cache/bind/naver.zone
:%s/localhost/ns.naver.com/g
IN A 192.168.0.1
ns IN A 192.168.0.1
www IN A 192.168.0.2
systemctl restart bind9
Lookup
apt install -y bind9 bind9-utils bind9-dnsutils
vim /etc/resolv.conf
nameserver 192.168.0.1
vim /etc/bind/named.conf
zone "0.168.192.in-addr.arpa"{
type master;
file "naver.re.zone";
};
vim /etc/bind/named.conf.options
dnssec-validation no;
cp /etc/bind/db.local /var/cache/bind/naver.zone
vim /var/cache/bind/naver.zone
:%s/localhost/ns.naver.com/g
IN A 192.168.0.1
ns IN A 192.168.0.1
www IN A 192.168.0.2
cp /etc/bind/db.local /var/cache/bind/naver.re.zone
vim /var/cache/bind/naver.re.zone
:%s/localhost/ns.naver.com/g
1 IN PTR ns.naver.com.
systemctl restart bind9
Master & Slave
Master
apt install -y bind9 bind9-utils bind9-dnsutils
vim /etc/resolv.conf
nameserver 192.168.0.1
search example.com
domain example.com
vim /etc/bind/named.conf
zone "example.com" {
type master;
file "example.zone";
allow-update { any; };
allow-transfer { 192.168.0.2; };
};
zone "0.168.192.in-addr.arpa" {
type master;
file "example.re.zone";
allow-update { any; };
allow-transfer { 192.168.0.2; };
};
vim /etc/bind/named.conf.options
dnssec-validation no;
cp /etc/bind/db.local /var/cache/bind/example.zone
vim /var/cache/bind/example.zone
:%s/localhost/Master.example.com/g
Master IN A 192.168.0.1
ns IN A 192.168.0.1
www IN A 192.168.0.2
cp /etc/bind/db.local /var/cache/bind/naver.re.zone
vim /var/cache/bind/example.re.zone
:%s/localhost/ns.naver.com/g
1 IN PTR ns.example.com.
systemctl restart bind9
Slave
apt install -y bind9 bind9-utils bind9-dnsutils
vim /etc/resolv.conf
nameserver 192.168.0.2
search example.com
domain example.com
vim /etc/bind/named.conf
zone "example.com" {
type slave;
masters { 192.168.0.1; };
file "example.zone";
};
zone "0.168.192.in-addr.arpa" {
type slave;
masters { 192.168.0.1; };
file "example.re.zone";
};
systemctl restart bind9