I l@ve RuBoard Previous Section Next Section

2.21 Storing the Location of a Host in DNS

2.21.1 Problem

You want to store the location of a host in your zone data.

2.21.2 Solution

Depending on what you mean by "location," add either a TXT or LOC record to the host's domain name.

Many administrators want to store a descriptive location for the host in DNS. For example, you might want to specify that the host a.foo.example is in on your Building 20's level C, near post C3K. To do that, you might add this TXT record to your zone:

a.foo.example.    IN    TXT    "Building 20, level C, post C3K"

If, on the other hand, you'd like to specify the host's geographical location (i.e., its latitude, longitude, and altitude), you can add a LOC record to your zone. For example, if a.foo.example is also at 40 degrees, 2 minutes, 0.373 seconds north latitude; 105 degrees, 17 minutes, 23.528 seconds west longitude; and 1,638 meters altitude, you could add this LOC record to your zone:

a.foo.example.    IN    LOC    40 2 0.373 N 105 17 23.528 W 1638m

2.21.3 Discussion

The TXT record is enormously versatile, since you can put just about anything into the RDATA. Just remember that only people who know to look up the TXT records for a domain name will find the data you store there. Also, if you add multiple TXT records to a domain name, there's no guarantee of the order in which the name server will return them.

The LOC record, on the other hand, is absolutely specialized: it only stores geographical location data. The format is exactly as I've shown it above, with separate RDATA fields for degrees, minutes, and seconds, followed by N for north, S for south, E for east, and W for west. And you can use negative elevation values if you happen to use a colocation facility in Death Valley.

If you're not sure what your hosts' latitude, longitude, and altitude are and you can't persuade your boss that you need a new GPS receiver to find out, you can use Etak's Eagle Geocoder (www.geocode.com/eagle.html-ssi) or AirNav's Airport Information, (www.airnav.com/airports/) to find the values for your address or a nearby airport, respectively.

2.21.4 See Also

For more information on LOC records, see the "Location" section of Chapter 16 of DNS and BIND, RFC 1876, or Christopher Davis's excellent web site at http://www.ckdhr.com/dns-loc/.

    I l@ve RuBoard Previous Section Next Section