본문 바로가기

해봐야 안다.OTL/Linux

[리눅스] DNS : udp, tcp질의하기

UDP 53: 일반적인 DNS 질의 및 응답

TCP 53: zone transfer와 같이 많은 용량을 전송할 때

UDP 53의 메시지 사이즈가 484 byte를 초과할 때 TCP로 재질의

 

<UDP를 이용한 DNS 질의>

[root@jo:~]#dig @ns.cho.iss www.cho.iss. any +novc

[root@jo:~]#dig @ns.cho.iss www.cho.iss. any +notcp

 

; <<>> DiG 9.3.4-P1 <<>> @ns.cho.iss www.cho.iss. any +notcp

; (1 server found)

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53597

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

 

;; QUESTION SECTION:

;www.cho.iss.            IN    ANY

 

;; ANSWER SECTION:

www.cho.iss.        86400    IN    A    192.168.100.100

 

;; AUTHORITY SECTION:

cho.iss.        86400    IN    NS    ns.cho.iss.

 

;; ADDITIONAL SECTION:

ns.cho.iss.        86400    IN    A    192.168.100.1

 

;; Query time: 0 msec

;; SERVER: 192.168.100.1#53(192.168.100.1)

;; WHEN: Wed Oct 28 11:17:02 2009

;; MSG SIZE rcvd: 78

--

<TCP를 이용한 DNS 질의>

[root@jo:~]#dig @ns.cho.iss www.cho.iss. any +vc

[root@jo:~]#dig @ns.cho.iss www.cho.iss. any +tcp

 

; <<>> DiG 9.3.4-P1 <<>> @ns.cho.iss www.cho.iss. any +tcp

; (1 server found)

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26578

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

 

;; QUESTION SECTION:

;www.cho.iss.            IN    ANY

 

;; ANSWER SECTION:

www.cho.iss.        86400    IN    A    192.168.100.100

 

;; AUTHORITY SECTION:

cho.iss.        86400    IN    NS    ns.cho.iss.

 

;; ADDITIONAL SECTION:

ns.cho.iss.        86400    IN    A    192.168.100.1

 

;; Query time: 3 msec

;; SERVER: 192.168.100.1#53(192.168.100.1)

;; WHEN: Wed Oct 28 11:17:05 2009

;; MSG SIZE rcvd: 78

--