Linux DNS Host Lookup


Tests domain name services, nslookup is a powerful interactive tool that comes with the BIND software.   dig and host are similar tools that can be used inside of shell scripts.

 

The host command is a very simple tool for looking up IP address.   


The format of the host command is:


  host [ options ] domain-name [ server ] 


Note

  • only the host command and the domain name of the remote host are needed to lookup an IP
  • enter other record type (mx, soa, ns, etc.,) with the -t argument in the options field
  • to query a specific server, identify the server in the server field

  ex. : 


  $ host -t any dolphin.example.org goat.example.org 


  using domain server 172.32.3.2:

  dolphin.example.org has address 172.32.3.8


  $ host -t any dolphin.example.org shark.fish.org


  using domain server 172.30.8.2:

  host not found