반응형

domain 주소의 응답을 확인하는 명령어인 nslookup 과 dig.

일반적으로 윈도우OS에서는 nslookup을 쓰고, linux계열 OS에서는 dig 명령을 쓴다.

(따로 프로그램을 설치하면 윈도우에서도 dig 명령 쓸 순 있지만)

 

어떤 옵션을 쓸 수 있는지 알아보자

 

우선, 확인 가능한 dns의 record type을 알아보자.

 

# 가장 많이 사용하는 top 10 dns record type 목록

 

o Address Mapping record (A Record)   
   - also known as a DNS host record, stores a hostname and its corresponding IPv4 address.

o IP Version 6 Address record (AAAA Record)   
   - stores a hostname and its corresponding IPv6 address.

o Canonical Name record (CNAME Record)
   - can be used to alias a hostname to another hostname. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.

o Mail exchanger record (MX Record)
   - specifies an SMTP email server for the domain, used to route outgoing emails to an email server.

o Name Server records (NS Record)  
   - specifies that a DNS Zone, such as “example.com” is delegated to a specific Authoritative Name Server, and provides the address of the name server.

o Reverse-lookup Pointer records (PTR Record)
   - allows a DNS resolver to provide an IP address and receive a hostname (reverse DNS lookup).

o Certificate record (CERT Record)
   - stores encryption certificates—PKIX, SPKI, PGP, and so on.

o Service Location (SRV Record) 
   - a service location record, like MX but for other communication protocols.

o Text Record (TXT Record)
   - typically carries machine-readable data such as opportunistic encryption, sender policy framework, DKIM, DMARC, etc.

o Start of Authority (SOA Record)  
   - this record appears at the beginning of a DNS zone file, and indicates the Authoritative Name Server for the current DNS zone, contact details for the domain administrator, domain serial number, and information on how frequently DNS information for this zone should be refreshed.

dns record type 전체 목록은 wiki 참고 (https://en.wikipedia.org/wiki/List_of_DNS_record_types)

 

# nslookup 과 dig 명령어 사용법 비교

case Windows nslookup command Linux dig command
Command format

Usage:
C> nslookup -type=
typename domainurl lookupdnsserver

type 옵션 대신 q 옵션을 쓸 수도 있다
C> nslookup -q=typename domainurl lookupdnsserver

 

Usage:
# dig [@global-server] [domain] [q-type] [q-class] {q-opt} {global-d-opt} host [@local-server] {local-d-opt} [ host [@local-server] {local-d-opt} [...]]





record type only

Usage
C> nslookup -type=
typename domainurl

C> nslookup -type=MX google.com

Usage:
# dig 
domainurl

# dig google.com MX

Select query-dns-server

Usage:
C> nslookup -type=
recordtype domainurl dns-server-ip

C> nslookup -type=MX google.com 1.1.1.1

Usage:
# dig @dns-server 
domainurl recordtype

# dig @1.1.1.1 google.com MX


 

#nslookup명령어사용법 #dig명령어사용법 #comparenslookupdig #howtousedig #howtousenslookup

 

반응형

+ Recent posts