host www.megacorpone.com www.megacorpone.com has address 149.56.244.87
Listing 38 - Using host to find the A host record for www.megacorpone.com By default, the host command searches for an A record, but we can also query other fields, such
as MX or TXT records, by specifying the record type in our query using the -t option.
kali@kali:~$
host -t mx megacorpone.com megacorpone.com mail is handled by 10 fb.mail.gandi.net.
megacorpone.com mail is handled by 20 spool.mail.gandi.net.
megacorpone.com mail is handled by 50 mail.megacorpone.com.
megacorpone.com mail is handled by 60 mail2.megacorpone.com.
Listing 39 - Using host to find the MX records for megacorpone.com In this case, we first ran the host command to fetch only megacorpone.com MX records, which
returned four different mail server records. Each server has a different priority (10, 20, 50, 60) and
the server with the lowest priority number will be used first to forward mail addressed to the
megacorpone.com domain (
fb.mail.gandi.net ).
We then ran the host command again to retrieve only the megacorpone.com TXT records, which
returned two entries.
kali@kali:~$
host -t txt megacorpone.com megacorpone.com descriptive text "Try Harder"
megacorpone.com descriptive text "google-site-
verification=U7B_b0HNeBtY4qYGQZNsEYXfCJ32hMNV3GtC0wWq5pA"
Listing 40 - Using host to find the TXT records for megacorpone.com Now that we have collected some initial data from the megacorpone.com domain, we can
continue to use additional DNS queries to discover more hostnames and IP addresses belonging
to the same domain. For example, we know that the domain has a web server with the hostname
“www.megacorpone.com”.
Let’s run host against this hostname.
kali@kali:~$
host www.megacorpone.com www.megacorpone.com has address 149.56.244.87
Listing 41 - Using host to search for a valid host Now, let’s determine if megacorpone.com has a server with the hostname “idontexist”. We’ll
observe the difference between the query outputs.
kali@kali:~$