RFC 1101:DNS Encoding of Network Names and Other T...
RFC-Ref

4. SPECIFICS FOR NETWORK NAME MAPPINGS

The proposed solution uses information stored at:

4.1. A simple example

The ARPANET is a Class A network without subnets. The RRs which would be added, assuming the ARPANET.ARPA was selected as a network name, would be:

   ARPA.                   PTR     0.0.0.10.IN-ADDR.ARPA.

   ARPANET.ARPA.           PTR     0.0.0.10.IN-ADDR.ARPA.

   0.0.0.10.IN-ADDR.ARPA.  PTR     ARPANET.ARPA.

The first RR states that the organization named ARPA owns net 10 (It might also own more network numbers, and these would be represented with an additional RR per net.) The second states that the network name ARPANET.ARPA. maps to net 10. The last states that net 10 is named ARPANET.ARPA.

Note that all of the usual host and corresponding IN-ADDR.ARPA entries would still be required.

4.2. A complicated, subnetted example

The ISI network is 128.9, a class B number. Suppose the ISI network was organized into two levels of subnet, with the first level using an additional 8 bits of address, and the second level using 4 bits, for address masks of x'FFFFFF00' and X'FFFFFFF0'.

Then the following RRs would be entered in ISI's master file for the ISI.EDU zone:

   ; Define network entry
   isi-net.isi.edu.                PTR  0.0.9.128.IN-ADDR.ARPA.

   ; Define first level subnets
   div1-subnet.isi.edu.            PTR  0.1.9.128.IN-ADDR.ARPA.
   div2-subnet.isi.edu.            PTR  0.2.9.128.IN-ADDR.ARPA.

   ; Define second level subnets
   inc-subsubnet.isi.edu.          PTR  16.2.9.128.IN-ADDR.ARPA.

   in the 9.128.IN-ADDR.ARPA zone:

   ; Define network number and address mask
   0.0.9.128.IN-ADDR.ARPA.         PTR  isi-net.isi.edu.
                                   A    255.255.255.0  ;aka X'FFFFFF00'

   ; Define one of the first level subnet numbers and masks
   0.1.9.128.IN-ADDR.ARPA.         PTR  div1-subnet.isi.edu.
                                   A    255.255.255.240 ;aka X'FFFFFFF0'

   ; Define another first level subnet number and mask
   0.2.9.128.IN-ADDR.ARPA.         PTR  div2-subnet.isi.edu.
                                   A    255.255.255.240 ;aka X'FFFFFFF0'

   ; Define second level subnet number
   16.2.9.128.IN-ADDR.ARPA.        PTR  inc-subsubnet.isi.edu.

This assumes that the ISI network is named isi-net.isi.edu., first level subnets are named div1-subnet.isi.edu. and div2- subnet.isi.edu., and a second level subnet is called inc- subsubnet.isi.edu. (In a real system as complicated as this there would be more first and second level subnets defined, but we have shown enough to illustrate the ideas.)

4.3. Procedure for using an IP address to get network name

Depending on whether the IP address is class A, B, or C, mask off the high one, two, or three bytes, respectively. Reverse the octets, suffix IN-ADDR.ARPA, and do a PTR query.

For example, suppose the IP address is 10.0.0.51.

      1. Since this is a class A address, use a mask x'FF000000' and
         get 10.0.0.0.

      2. Construct the name 0.0.0.10.IN-ADDR.ARPA.

      3. Do a PTR query.  Get back

         0.0.0.10.IN-ADDR.ARPA.  PTR     ARPANET.ARPA.

      4. Conclude that the network name is "ARPANET.ARPA."

Suppose that the IP address is 128.9.2.17.

      1. Since this is a class B address, use a mask of x'FFFF0000'
         and get 128.9.0.0.

      2. Construct the name 0.0.9.128.IN-ADDR.ARPA.

      3. Do a PTR query.  Get back

         0.0.9.128.IN-ADDR.ARPA.       PTR     isi-net.isi.edu

      4. Conclude that the network name is "isi-net.isi.edu."

4.4. Procedure for finding all subnets involved with an IP address

This is a simple extension of the IP address to network name method. When the network entry is located, do a lookup for a possible A RR. If the A RR is found, look up the next level of subnet using the original IP address and the mask in the A RR. Repeat this procedure until no A RR is found.

For example, repeating the use of 128.9.2.17.

      1. As before construct a query for 0.0.9.128.IN-ADDR.ARPA.
         Retrieve:

         0.0.9.128.IN-ADDR.ARPA.  PTR    isi-net.isi.edu.
                                  A      255.255.255.0

      2. Since an A RR was found, repeat using mask from RR
         (255.255.255.0), constructing a query for
         0.2.9.128.IN-ADDR.ARPA.  Retrieve:

         0.2.9.128.IN-ADDR.ARPA.  PTR    div2-subnet.isi.edu.
                                  A      255.255.255.240

      3. Since another A RR was found, repeat using mask
         255.255.255.240 (x'FFFFFFF0').  constructing a query for
         16.2.9.128.IN-ADDR.ARPA.  Retrieve:

         16.2.9.128.IN-ADDR.ARPA. PTR    inc-subsubnet.isi.edu.

      4. Since no A RR is present at 16.2.9.128.IN-ADDR.ARPA., there
         are no more subnet levels.

Google
Web
RFC-Ref