Check version of DNS Server

nslookup -q=txt -class=CHAOS version.bind NS.PHX5.NEARLYFREESPEECH.NET
Sample Output
maggie:~ root# nslookup -q=txt -class=CHAOS version.bind NS.PHX5.NEARLYFREESPEECH.NET
Server:		NS.PHX5.NEARLYFREESPEECH.NET
Address:	208.94.116.129#53
version.bind	text = "9.3.4-P1"

0
2009-06-02 19:54:24

These Might Interest You

  • In a multiple PostgreSQL server environment knowing the servers version can be important. Note that psql --version returns just the local psql apps version which may not be what you want. This command dumps the PostgreSQL servers version out to one line. You may need to add more command line options to the psql command for your connection environment. Show Sample Output


    0
    psql -h <SERVER NAME HERE> -c 'SELECT version();' | grep -v 'version\|---\|row\|^ *$' | sed 's/^\s*//'
    pnelsonsr · 2014-03-17 18:36:40 0
  • This version uses netcat to check a particular service.


    1
    nc -zw2 www.example.com 80 || echo http service is down | mail -s 'http is down' admin@example.com
    putnamhill · 2010-09-08 13:18:16 0
  • Due to the recent dynamic update vulnerability with bind, I was forced to dig a little deeper into dig... Show Sample Output


    8
    dig -t txt -c chaos VERSION.BIND @<dns.server.com>
    din7 · 2009-07-30 18:38:39 3
  • This version is precise and requires one second to collect statistics. Check sample output for a more generic version and also a remote computer invocation variant. It doesn't work with the busybox version of the 'top' command but can be adjusted Show Sample Output


    1
    top -bn2|awk -F, '/Cpu/{if (NR>4){print 100-gensub(/.([^ ]+).*/,"\\1","g",$4)}}'
    ichbins · 2014-04-18 17:48:05 0

What Others Think

Note that nslookup is considered obsolete. Better use dig or host, e.g.: host -t txt -c chaos version.bind. ns1.isc-sns.net.
inof · 472 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: