Your browser doesn't seem to support CSS, which this page uses for all styling. Don't be surprised if it looks kinda boring.

[Jump to nav]

dinfo.pl

Summary

dinfo is a program I tossed together to make it easier to query a bunch of information about a given domain from the DNS.

I've been doing this set of queries for ages. With nslookup(1). With host(1). With dig(1). Do 'em all the time, checking on this or that.

So finally I got sick of typing the same dozen commands over and over again. And mistyping them a lot, and having to retype them a lot.

So, here's dinfo. It's a perl script that you run from the command line, giving it a set of domains as arguments. It requires perl (duh) and the Net::DNS module, which you can find at CPAN if you don't already have it. It then recurses over that list of domains looking up and printing out what info it can find on the domain. Generally, it outputs a set of information including:

  • The record (A or CNAME) for the domain itself
  • The record (A or CNAME) for the host "www.<domain>"
  • A list (in order) of MX servers for the domain
  • A list of nameservers that the lower-level servers claim are authoritative for the domain.
  • A list of nameservers that the zone file on the authoritative nameserver itself claims are authoritative for the domain.
  • The SOA contact address

Then it moves on to the next domain in the list you gave it.

It doesn't use your DNS cache, but instead does its own recursion from the root servers on up. It maintains its own internal cache, so if you pass it a lot of servers, it'll cache what it can along the way. So if you query a dozen .com domains, a half-dozen .net's, a handful of .org's, 3 or 4 .uk's... it will only hit the root servers looking for ".com", once for ".net", etc. So, if you're querying multiple domains (especially a large number) it really pays to do 'em all at once. It's quicker for you, and nicer to the rest of the world.

Installation

There is no install. The tarball contains a LICENSE file, a quick runover README, and the script itself. Run it out of the directory you untar'd it in. Stick in in your ~/bin. Stick it in /usr/local/bin. Hell, stick it in /dev for all I care.

Downloads

dinfo.pl 1.1 is the current version. It fixes up a few bogons in 1.0 where a host with both IPv4 and IPv6 addresses would display them a little weird, an infinite loop on a domain lookup error, and some cosmetic flaws in the output when someone's domain has a screwy setup.

If you really like bugs, then v1.0 is still here too.