centos21_네임서버 구축
domain :텍스트
ip : 숫자
DNS :
Domain Name Server
윈도우 명령어
nslookup
C:\Users\choi>nslookup
기본 서버:  bns1.hananet.net
Address:  210.220.163.82
> google.com
서버:    bns1.hananet.net
Address:  210.220.163.82
권한 없는 응답:
이름:    google.com
Addresses:  2404:6800:4005:80
          1.255.33.241
          1.255.33.237
          1.255.33.246
          1.255.33.232
          1.255.33.212
          1.255.33.231
          1.255.33.217
          1.255.33.221
          1.255.33.226
          1.255.33.236
          1.255.33.247
          1.255.33.227
          1.255.33.222
          1.255.33.242
          1.255.33.251
          1.255.33.216
> daum.net
서버:    bns1.hananet.net
Address:  210.220.163.82
권한 없는 응답:
이름:    daum.net
Addresses:  61.111.62.173
          114.108.157.19
          110.45.215.23
          114.108.157.50
>
리눅스 ex)
[root@localhost ~]# nslookup
> fsdf
Server:        168.126.63.1
Address:    168.126.63.1#53
** server can't find fsdf: NXDOMAIN
> nate.com
Server:        168.126.63.1
Address:    168.126.63.1#53
Non-authoritative answer:
Name:    nate.com
Address: 120.50.131.112
Name:    nate.com
Address: 120.50.132.112
==============================
# gedit /etc/resolv.conf
마지막 라인을 주석 처리
(nameserver 168.126.63.1)
네임서버 주석 처리
그리고
인터넷을 연결 하면 
연결이 안된다.
그러나 ip 번호는 연결가능
도메인 주소 요청 =>hosts 파일 조회 =>네임서버 조회
# gedit /etc/hosts
마지막 줄에 추가
120.50.132.112   www.nate.com 
=>결과 nate.com 으로 쳐도 연결 된다.
127.0.0.1 my.com
추가
결과 => my.com 으로 내 컴퓨터에서 연결된다.
네임서버 구축
설치전 # gedit /etc/resolv.conf
네임서버 주석 처리 제거 이름을 못찾아서 설치가 안됨.
# gedit /etc/hosts 도 원래데로..
네임 서버 설치
# yum -y install bind bind-chroot
네임서버 설정 파일 수정
# gedit /etc/named.conf
변경
options {
    listen-on port 53 { 127.0.0.1; };
    listen-on-v6 port 53 { ::1; };
    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";
    allow-query     { localhost; };
=>
13번 라인(모든 ip에서 조회 가능)
    listen-on port 53 { any; };
14번 라인 (모든 ip에서 조회 불가능)
    listen-on-v6 port 53 { none; };
19번 라인(모든 ip에서 조회 가능)
    allow-query  { any;};
외부에서 연결 가능하도록 방화벽 오픈
방화벽에서 53번 포트 개방
# firewall-cmd --add-port=53/tcp --permanent
방화벽 업데이트
# firewall-cmd --reload
네임서버 서비스 재시작
# systemctl restart named
네임서버 서비스 상태
# systemctl status named
네임서버 서비스 자동시작
# systemctl enable named
# nslookup
> server 본인리눅스 서버 IP
결과 
gedit /etc/resolv.conf
로 #nameserver 168.126.63.1
주석처리를 해도
네임으로 웹 사이트가 연결 된다.
 














댓글 ( 4)  
댓글 남기기