Useful macOS network terminal commands – Query forward and reverse lookup on a local DNS server


In this video, we take a look at a macOS terminal command that will allow us to query forward and reverse lookups on a local DNS server. This command can be particularly handy when testing a DNS server that you have installed onto your local network.

Note: As Network Utility was deprecated in macOS 11, we recommend that you use this command when testing the configuration of a DNS server on a Synology NAS.

Quick reference notes:

  • From your macOS desktop, select Spotlight Search.
  • Within Spotlight Search type Terminal and press Enter on your keyboard
  • To perform a forward lookup on a local DNS server, at the command prompt type.
host [hostname.example.com]
  • When you press Enter on the keyboard you should be presented with the IP address associated with that domain name.
  • To perform a reverse lookup on a local DNS Server, at the command prompt type.
host [IP address]
  • When you press Enter on the keyboard, you should be presented with the domain name associated with that IP address
  • To gracefully close your current Terminal session type:
exit
  • When you press Enter on your keyboard the Terminal session will end and you can close the Terminal application.

Reference Material:

Wikipedia article – Terminal (macOS)

Add comment

Leave a Reply

Thank you for your support

Advertisement

%d bloggers like this: