[네트워크] DNS 서버 구축하고 연결 (내부에서)

황서희·2023년 1월 27일
0
yum install bind bind-chroot bind-utils
vi /etc/named.conf

options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { none; };
        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     { any; };
        masterfile-format text;
named-checkconf /etc/named.conf

아무것도 안 뜨면 OK

vi /etc/named.rfc1912.zones

zone "test.com" IN {
        type master;
        file "test.com.zone";
        allow-update { none; };
};
cp /var/named/named.localhost /var/named/test.com.zone

chown root:named /var/named/test.com.zone
vi /var/named/test.com.zone

$TTL 1D
@       IN SOA  test.com. root. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS   ns.test.com.
        IN A    192.168.0.26
NS      IN A    192.168.0.25
www     IN A    192.168.0.26
vi /etc/resolv.conf

# Generated by NetworkManager

search kornet
nameserver 192.168.0.25
nameserver 168.126.63.1
nameserver 168.126.63.2
nameserver 8.8.8.8
service named restart
systemctl enable named
nslookup
> test.com
Server:         192.168.0.25
Address:        192.168.0.25#53

Name:   test.com
Address: 192.168.0.26

원격 데스크탑에서 접속시 접속 가능

profile
다 아는 건 아니어도 바라는 대로

0개의 댓글