NS Server을 다음과 같이 되도록 설정하시오.
1. IP Alias로 IP를 부여해준다.
- 참고
DNS 서버는 IP의 정보만 가지고 있으면 되므로 실제적으로 IP Alias 를 안해줘도 된다.
PING을 해보려면 IP Alias를 해주면 된다.
# ifconfig eth0:0 192.168.33.3 netmask 255.255.255.0 broadcast 192.168.255.255
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:76:1C:2F:A5
inet addr:10.10.33.3 Bcast:10.10.255.255 Mask:255.255.0.0
inet6 addr: fe80::216:76ff:fe1c:2fa5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47476 errors:0 dropped:0 overruns:0 frame:0
TX packets:23687 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32230969 (30.7 MiB) TX bytes:4985521 (4.7 MiB)
eth0:0 Link encap:Ethernet HWaddr 00:16:76:1C:2F:A5
inet addr:192.168.33.3 Bcast:192.168.255.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- IP Alias를 통해 IP를 추가해 준 모습
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2842 errors:0 dropped:0 overruns:0 frame:0
TX packets:2842 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1992006 (1.8 MiB) TX bytes:1992006 (1.8 MiB)
-----------------------------------------------------------------------------------------------------
2. DNS의 환경설정파일
# vi /etc/named.rfc1912.zones - server3.co.kr, centos3.co.kr 에 대한 정보를 추가한다.
zone "server3.co.kr" IN {
type master;
file "server3.zone";
allow-update { none; };
};
zone "33.10.10.in-addr.arpa" IN {
type master;
file "server3.rzone";
allow-update { none; };
};
zone "centos3.co.kr" IN {
type master;
file "centos3.zone";
allow-update { none; };
};
zone "33.168.192.in-addr.arpa" IN {
type master;
file "centos3.rzone";
allow-update { none; };
};
-----------------------------------------------------------------------------------------------------
3. Zone 파일 설정
# pwd
/var/named/chroot/var/named - zone의 원본 파일이 있는 곳
# ls -l
-rw-r----- 1 root named 198 5월 25 2008 localdomain.zone
-rw-r----- 1 root named 426 5월 25 2008 named.local
# cp -p localdomain.zone server3.zone
# cp -p named.local server3.rzone
3-1. Forward zone
server3.zone
$TTL 86400
@ IN SOA server3.co.kr. root.server3.co.kr. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS server3.co.kr.
IN A 10.10.33.3
www IN A 10.10.33.3
centos3.zone
$TTL 86400
@ IN SOA centos3.co.kr. root.centos3.co.kr. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS cenros3.co.kr.
IN A 192.168.33.3
www IN A 192.168.33.3
3-2. Reverse zone
server3.rzone
$TTL 86400
@ IN SOA server3.co.kr. root.server3.co.kr. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS server3.co.kr.
3 IN PTR server3.co.kr.
3 IN PTR www.server3.co.kr.
centos3.rzone
$TTL 86400
@ IN SOA centos3.co.kr. root.centos3.co.kr. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS centos3.co.kr.
3 IN PTR centos3.co.kr.
3 IN PTR www.centos3.co.kr.
-참고
3 은 자신의 ip주소이다. 만약 이부분을 입력하지않으면 192.168.33.3에 대한 도메인 서버를 찾지 못한다.
ex)
# host 10.10.33.3
Host 3.33.10.10.in-addr.arpa not found: 3(NXDOMAIN)
# nslookup 10.10.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
** server can't find 3.33.10.10.in-addr.arpa: NXDOMAIN
-----------------------------------------------------------------------------------------------------
4. DNS Server 서비스를 재시작한다.
# service named restart
named를 정지 중: [ OK ]
named를 시작 중: [ OK ]
-----------------------------------------------------------------------------------------------------
5. DNS Server가 제대로 작동하는지 확인
# nslookup server3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: server3.co.kr
Address: 10.10.33.3
# nslookup www.server3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: www.server3.co.kr
Address: 10.10.33.3
# nslookup centos3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: centos3.co.kr
Address: 192.168.33.3
# nslookup www.centos3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: www.centos3.co.kr
Address: 192.168.33.3
# nslookup 192.168.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
3.33.168.192.in-addr.arpa name = www.centos3.co.kr.
3.33.168.192.in-addr.arpa name = centos3.co.kr.
# nslookup 192.168.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
3.33.168.192.in-addr.arpa name = www.centos3.co.kr.
3.33.168.192.in-addr.arpa name = centos3.co.kr.
Domain | IP | NS |
server3.co.kr | 10.10.33.3 |
server3.co.kr |
www.server3.co.kr | 10.10.33.3 |
server3.co.kr |
centos3.co.kr | 192.168.33.3 |
centos3.co.kr |
www.centos3.co.kr | 192.168.33.3 |
centos3.co.kr |
1. IP Alias로 IP를 부여해준다.
- 참고
DNS 서버는 IP의 정보만 가지고 있으면 되므로 실제적으로 IP Alias 를 안해줘도 된다.
PING을 해보려면 IP Alias를 해주면 된다.
# ifconfig eth0:0 192.168.33.3 netmask 255.255.255.0 broadcast 192.168.255.255
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:76:1C:2F:A5
inet addr:10.10.33.3 Bcast:10.10.255.255 Mask:255.255.0.0
inet6 addr: fe80::216:76ff:fe1c:2fa5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:47476 errors:0 dropped:0 overruns:0 frame:0
TX packets:23687 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32230969 (30.7 MiB) TX bytes:4985521 (4.7 MiB)
eth0:0 Link encap:Ethernet HWaddr 00:16:76:1C:2F:A5
inet addr:192.168.33.3 Bcast:192.168.255.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- IP Alias를 통해 IP를 추가해 준 모습
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:2842 errors:0 dropped:0 overruns:0 frame:0
TX packets:2842 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1992006 (1.8 MiB) TX bytes:1992006 (1.8 MiB)
-----------------------------------------------------------------------------------------------------
2. DNS의 환경설정파일
# vi /etc/named.rfc1912.zones - server3.co.kr, centos3.co.kr 에 대한 정보를 추가한다.
zone "server3.co.kr" IN {
type master;
file "server3.zone";
allow-update { none; };
};
zone "33.10.10.in-addr.arpa" IN {
type master;
file "server3.rzone";
allow-update { none; };
};
zone "centos3.co.kr" IN {
type master;
file "centos3.zone";
allow-update { none; };
};
zone "33.168.192.in-addr.arpa" IN {
type master;
file "centos3.rzone";
allow-update { none; };
};
-----------------------------------------------------------------------------------------------------
3. Zone 파일 설정
# pwd
/var/named/chroot/var/named - zone의 원본 파일이 있는 곳
# ls -l
-rw-r----- 1 root named 198 5월 25 2008 localdomain.zone
-rw-r----- 1 root named 426 5월 25 2008 named.local
# cp -p localdomain.zone server3.zone
# cp -p named.local server3.rzone
3-1. Forward zone
server3.zone
$TTL 86400
@ IN SOA server3.co.kr. root.server3.co.kr. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS server3.co.kr.
IN A 10.10.33.3
www IN A 10.10.33.3
centos3.zone
$TTL 86400
@ IN SOA centos3.co.kr. root.centos3.co.kr. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS cenros3.co.kr.
IN A 192.168.33.3
www IN A 192.168.33.3
3-2. Reverse zone
server3.rzone
$TTL 86400
@ IN SOA server3.co.kr. root.server3.co.kr. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS server3.co.kr.
3 IN PTR server3.co.kr.
3 IN PTR www.server3.co.kr.
centos3.rzone
$TTL 86400
@ IN SOA centos3.co.kr. root.centos3.co.kr. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS centos3.co.kr.
3 IN PTR centos3.co.kr.
3 IN PTR www.centos3.co.kr.
-참고
3 은 자신의 ip주소이다. 만약 이부분을 입력하지않으면 192.168.33.3에 대한 도메인 서버를 찾지 못한다.
ex)
# host 10.10.33.3
Host 3.33.10.10.in-addr.arpa not found: 3(NXDOMAIN)
# nslookup 10.10.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
** server can't find 3.33.10.10.in-addr.arpa: NXDOMAIN
-----------------------------------------------------------------------------------------------------
4. DNS Server 서비스를 재시작한다.
# service named restart
named를 정지 중: [ OK ]
named를 시작 중: [ OK ]
-----------------------------------------------------------------------------------------------------
5. DNS Server가 제대로 작동하는지 확인
# nslookup server3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: server3.co.kr
Address: 10.10.33.3
# nslookup www.server3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: www.server3.co.kr
Address: 10.10.33.3
# nslookup centos3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: centos3.co.kr
Address: 192.168.33.3
# nslookup www.centos3.co.kr
Server: 10.10.33.3
Address: 10.10.33.3#53
Name: www.centos3.co.kr
Address: 192.168.33.3
# nslookup 192.168.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
3.33.168.192.in-addr.arpa name = www.centos3.co.kr.
3.33.168.192.in-addr.arpa name = centos3.co.kr.
# nslookup 192.168.33.3
Server: 10.10.33.3
Address: 10.10.33.3#53
3.33.168.192.in-addr.arpa name = www.centos3.co.kr.
3.33.168.192.in-addr.arpa name = centos3.co.kr.
'Linux Server 구축 > 1-1. DNS Server' 카테고리의 다른 글
보조네임서버구축 (Secondary Name Server) (0) | 2008.12.11 |
---|---|
DNS 도메인 추가1 (0) | 2008.12.11 |
DNS 관련 명렁어 (0) | 2008.12.11 |
DNS(Domain Name System) Server 구축 (0) | 2008.12.10 |