도메인 네임 서버에 질의하여 결과값을 돌려받는 명령어이다. 
nslookup은 네임서버 설정을 점검하는 좋은 명령어다. /etc/resolv.conf에 지정되어 있는 네임서버를 기본값으로 인식하여 쿼리를 보낸다.
네임 서버에 대한 자세한 설명은 데몬 설명 부분을 참고 하자.
noninteractive 모드로 찾고자 하는 호스트의 address를 쿼리를 할 수 있다. 만일 아래와 같은 에러 메시지가 나온다면 제대로된 네임서버 설정이 제대로 안된 결과이므로, 관련 설정을 살펴보아야 한다.
 
아래와 같이, Name은 linux.net로 Address는 61.77.63.1로 /etc/resolv.conf의 내용과 동일하게 나오므로 네임서버의 설정이 이상 없음을 알 수 있다.
interactiv 모드로 DNS 레코드 유형에 대해 자세한 쿼리를 할 수 있다. 이는, nslookup 명령 후 나타나는 ">" 입력 부분에 네임서버의 쿼리를 위한 레코드를 set type형태로 지정하여, 자세한 정보를 볼 수 있다.
먼저 set type=SOA 모드로 linux.net에 쿼리를 해 보자. 이를 통해 네임서버의 포워드 존 파일의 SOA 레코드 값들을 살펴 볼 수 있다.
 
set type=MX 모드로 MX레코드를 쿼리해 보자.
 
type ANY 옵션으로 주어진 호스트명과 관련된 모든 리소스 레코드를 볼 수 있다.
관련 type 값은 다음과 같다.
참고로 set type에 지정 가능한 관련 type 값을 살펴보자.
A : 호스트 어드레스
ANY : 대부분 관련된 정보
CNAME : 알리아스와 관련된 CNAME(Canonical name) 레코드 정보
HINFO : 호스트의 CPU와 운영체제를 지정하는 HINFO 레코드 정보
MD : MD(Mail Destination)레코드 정보
MG : MG(Mail group member)레코드 정보
MINFO : 메일박스나 메일리스트 관련인 MINFO(Mailbox or mail list information)레코드 정보
MR : MR(Mail rename)레코드 정보
MX : MX(Mail exchanger)레코드 정보
NS : NS(Nameserver)레코드 정보
PTR : 호스트 네임 지정 PTR 레코드 정보
SOA : SOA(Domain start-of-authortiy)레코드 정보
UINFO : UINFO(User information)레코드 정보
					
					
					
					
					
					사용법 : nslookup [-옵션...] [host_to_find | -서버]
nslookup은 네임서버 설정을 점검하는 좋은 명령어다. /etc/resolv.conf에 지정되어 있는 네임서버를 기본값으로 인식하여 쿼리를 보낸다.
네임 서버에 대한 자세한 설명은 데몬 설명 부분을 참고 하자.
# cat /etc/resolv.conf nameserver 61.77.63.1 nameserver 168.126.63.1
noninteractive 모드로 찾고자 하는 호스트의 address를 쿼리를 할 수 있다. 만일 아래와 같은 에러 메시지가 나온다면 제대로된 네임서버 설정이 제대로 안된 결과이므로, 관련 설정을 살펴보아야 한다.
# nslookup linux.net ** server can't find linuxroot.co.kr: NXDOMAIN
아래와 같이, Name은 linux.net로 Address는 61.77.63.1로 /etc/resolv.conf의 내용과 동일하게 나오므로 네임서버의 설정이 이상 없음을 알 수 있다.
# nslookup linux.net Note: nslookup is deprecated and may be removed from future releases. Consider using the `dig' or `host' programs instead. Run nslookup with the `-sil[ent]' option to prevent this message from appearing. Server: 61.77.63.1 Address: 61.77.63.1#53 Name: linux.net Address: 207.36.86.73
interactiv 모드로 DNS 레코드 유형에 대해 자세한 쿼리를 할 수 있다. 이는, nslookup 명령 후 나타나는 ">" 입력 부분에 네임서버의 쿼리를 위한 레코드를 set type형태로 지정하여, 자세한 정보를 볼 수 있다.
먼저 set type=SOA 모드로 linux.net에 쿼리를 해 보자. 이를 통해 네임서버의 포워드 존 파일의 SOA 레코드 값들을 살펴 볼 수 있다.
# nslookup 
Note:  nslookup is deprecated and may be removed from future releases. 
Consider using the `dig' or `host' programs instead.  Run nslookup with 
the `-sil[ent]' option to prevent this message from appearing. 
> set type=type 
unknown query type: type 
> linux.net 
Server:         61.77.63.1 
Address:        61.77.63.1#53 
Non-authoritative answer: 
Name:   linux.net 
Address: 207.36.86.73 
Name:   realname 
Address: 211.106.67.221 
> set type=SOA 
> linux.net 
Server:         61.77.63.1 
Address:        61.77.63.1#53 
linux.net 
        origin = ns1.primarydns.com 
        mail addr = hostmaster.primarydns.com 
        serial = 200404060 
        refresh = 10800 
        retry = 3600 
        expire = 21600 
        minimum = 3600 set type=MX 모드로 MX레코드를 쿼리해 보자.
> linux.net Server: 61.77.63.1 Address: 61.77.63.1#53 linux.net mail exchanger = 0 sitemail.everyone.net. >
type ANY 옵션으로 주어진 호스트명과 관련된 모든 리소스 레코드를 볼 수 있다.
관련 type 값은 다음과 같다.
> set type=ANY 
> linux.net 
Server:         61.77.63.1 
Address:        61.77.63.1#53 
Non-authoritative answer: 
linux.net       nameserver = ns1.primarydns.com. 
linux.net       nameserver = ns2.primarydns.com. 
Name:   linux.net 
Address: 207.36.86.73 
linux.net 
        origin = ns1.primarydns.com 
        mail addr = hostmaster.primarydns.com 
        serial = 200404060 
        refresh = 10800 
        retry = 3600 
        expire = 21600 
        minimum = 3600 
linux.net       mail exchanger = 0 sitemail.everyone.net. 
Authoritative answers can be found from: 
linux.net       nameserver = ns1.primarydns.com. 
linux.net       nameserver = ns2.primarydns.com. 
ns1.primarydns.com      internet address = 216.219.239.7 
ns2.primarydns.com      internet address = 216.219.239.8 
sitemail.everyone.net   internet address = 216.200.145.35 참고로 set type에 지정 가능한 관련 type 값을 살펴보자.
A : 호스트 어드레스
ANY : 대부분 관련된 정보
CNAME : 알리아스와 관련된 CNAME(Canonical name) 레코드 정보
HINFO : 호스트의 CPU와 운영체제를 지정하는 HINFO 레코드 정보
MD : MD(Mail Destination)레코드 정보
MG : MG(Mail group member)레코드 정보
MINFO : 메일박스나 메일리스트 관련인 MINFO(Mailbox or mail list information)레코드 정보
MR : MR(Mail rename)레코드 정보
MX : MX(Mail exchanger)레코드 정보
NS : NS(Nameserver)레코드 정보
PTR : 호스트 네임 지정 PTR 레코드 정보
SOA : SOA(Domain start-of-authortiy)레코드 정보
UINFO : UINFO(User information)레코드 정보



