TCP IP Illustrated

The in addrarpa solution is a clever one although the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: FQDN for the host would be edu.noao.tuc.sun. If there was not a separate branch of the DNS tree for handling this address-to-name translation, there would be no way to do the reverse translation other than starting at the root of the tree and trying every top-level domain. This could literally take days or weeks, given the current size of the Internet. The in-addr.arpa solution is a clever one, although the reversed bytes of the IP address and the special domain are confusing. Having to worry about the in-addr.arpa domain and reversing the bytes of the IP address affects us only if we're dealing directly with the DNS, using a program such as host, or watching the packets with tcpdump. From an application's point of view, the normal resolver function (gethostbyaddr) takes an IP address and returns information about the host. The reversal of the bytes and appending the domain in-addr.arpa are done automatically by this resolver function. Example Let's use the host program to do a pointer lookup and watch the packets with tcpdump. We'll use the same setup as in Figure 14.9, running the host program on the host sun, and the name server on the host noao.edu. We specify the IP address of our host svr4: sun % host 140.252.13.34 Name: svr4.tuc.noao.edu Address: 140.252.13.34 Since the only command-line argument is an IP address, the host program automatically generates the pointer query. Figure 14.12 shows the tcpdump output. 1 0.0 2 0.332288 (0.3323) 140.252.1.29.1610 > 140.252.1.54.53: 1+ PTR? 34.13.252.140.in-addr.arpa. (44) 140.252.1.54.53 > 140.252.1.29.1610: 1* 1/0/0 PTR svr4.tuc.noao.edu. (75) Figure 14.12 tcpdump output for a pointer query. Line 1 shows that the identifier is 1, the recursion-desired flag is set (the plus sign), and the query type is PTR. (Recall that the question mark means this is a query and not a response.) The data size of 44 bytes is from the 12-byte DNS header, 28 bytes for the 7 labels in the domain name, and 4 bytes for the query type and query class. The reply has the authoritative-answer bit set (the asterisk) and contains one answer RR. The RR type is PTR and the resource data contains the domain name. What is passed from the r...
View Full Document

Ask a homework question - tutors are online