When closing a server you might need to check which domains (still) point there, which can be a long and error-prone process.

So, take a list of your domains, which here is called list,txt. One domain per line without any hostname like www,

Look them all up (see below) and then output the tab-separated results (domain, ip, www ip) to standard output that you can pipe to a file.

Import to a spreadsheet or database then sort.

Here's an example in php (command line), could just as easily be Perl, a bash script, or any other language.

<?php
$domains = file('list.txt',FILE_IGNORE_NEW_LINES);
foreach ($domains as $dom) {
  $ip = gethostbyname($dom);
  $wwwip = gethostbyname("www.$dom");
  echo "$dom\t$ip\t$wwwip\n";
};
?>

Remember to use DNS that the rest of the world can see (such as OpenDNS), rather than your own which may be inaccurate.

There's nothing like actually checking what the world sees, rather than relying on lists or what a control panel setting thinks!

Another use for this is to run it daily and compare with the previous day, and send an altert if it's changed. If a domain has moved to a place you didn't move it to it's worth looking into...