How To: Mac Terminal Lookup DNS Records of a Domain Name

How To: Mac Terminal Lookup DNS Records of a Domain Name

You can use Terminal in Mac to lookup any and all associated host records for any domain name on the Internet. This is useful if you want to know certain information about a website or domain including geolocation of website hosted, check for email mx records, and validating a domain SPF record.

 

1. Open Terminal (Applications -> Utilities -> Terminal)

2. To get a list of host commands type

host –help

 

Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time]





            [-R number] [-m flag] hostname [server]

       -a is equivalent to -v -t ANY

       -c specifies query class for non-IN data

       -C compares SOA records on authoritative nameservers

       -d is equivalent to -v

       -l lists all hosts in a domain, using AXFR

       -i IP6.INT reverse lookups

       -N changes the number of dots allowed before root lookup is done

       -r disables recursive processing

       -R specifies number of retries for UDP packets

       -s a SERVFAIL response should stop query

       -t specifies the query type

       -T enables TCP/IP mode

       -v enables verbose output

       -w specifies to wait forever for a reply

       -W specifies how long to wait for a reply

       -4 use IPv4 query transport only

       -6 use IPv6 query transport only

       -m set memory debugging flag (trace|record|usage)

3. We will use –a to find out all records associated with google.com. Type the following command into Terminal.

host –a google.com

Mac terminal list host dns records google

 

4. We see a list of all associated records for google.com. At the bottom, the query was performed using google DNS which we have configured on our Mac network connection.

* Please use the comment form below. Comments are moderated.*



Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Monday, 23 December 2024