A DNS record type as per RFC 1876.

LOC in this context is short for location. This unusual DNS record is used to keep track of the physical location of a host, domain, or network. It is specified in the standard latitude and longitude format along with the altitude. Although an extension will probably be needed once we settle on the moon and mars.

Adding LOC records to our DNS has been a fun project. Some traceroute programs will display the approximate physical path that your data takes, but in the absence of a LOC record, they can only look up the postcode/ZIP code associated with a netblock.

To improve on this, I started with the mailing address of each of the locations on our WAN. I fed these addresses into MapBlast to get the latitude and longitude. (Most map sites can do the same thing.) The coordinates you'll get aren't amazingly accurate, but they're good enough -- probably as accurate as civilian GPS, anyway.

If you're playing along at home, the next thing you'll want to do is consult your national map department. In the United States, this is the United States Geological Survey (USGS). They can point you to a topographic map of the area you're looking at. (Your local public library may have some maps, too; if not, a university library may be your best bet.)

Reading a USGS topographic map is tricky for the uninitiated. First, locate the place you're interested in. You should see curved or squiggly lines near it -- these are contour lines. With any luck, one or more of them will have numbers written on it -- this, on a USGS map, is the altitude in feet. If you're near a body of water, its altitude should be marked near the center -- if it's the sea, then obviously it's probably altitude 0 (sea level). Look at other altitude markings to determine which way is up -- that is, whether your location is higher or lower than the marked altitude. As you trace a path from the known altitude to your location, add or subtract 5 feet for each contour line you cross. (Thicker lines mark altitudes of 25, 50, 75, 100, etc. feet.) If your location is between two contour lines, take the average.

Finally, if the map is marked in feet, convert your units to the metric system. For moderate altitudes, you can usually just divide the number of feet by three. This isn't rocket science, and nobody's going to get lost or killed if you're off by a meter or two. But hey, if you're taking the time to create LOC records for your DNS server, you probably give a damn, so divide by 3.2808398950131 and remember that your accuracy won't be better than a meter or so anyway because of the 5-foot contour lines. So there.

Finally, put your location into a properly formatted LOC record. As an example:

inet-router.tblc.org.           LOC     27 57 40 N 82 19 58 W 15m

This specifies a location of 27 degrees, 57 minutes, 40 seconds north, 82 degrees, 19 minutes, 58 seconds west, and 15 meters altitude.

I'm not a geographer, so I'd welcome suggestions on improving this.

Log in or registerto write something here or to contact authors.