Hacker News new | ask | show | jobs
by Canada 2644 days ago
Usually something like this:

cat /tmp/wants.txt | while read d; do echo -n $d:; dig $d in ns | grep '>>HEADER<<' | awk '{print $6}'; done

You get NXDOMAIN if it doesn't exist. That doesn't necessarily mean you can register it though. Maybe it's expired but in the grace period, or some other kind of exits-but-disabled state. If it does exist it might be for sale. Anyway, for quickly checking what's probably unregistered from the shell this one liner works great. A whois query usually takes about a second. Dig takes about a tenth of a second, and DNS queries aren't rate limited like WHOIS.