How to use `-type=mx` option In Linux

Syntax:

nslookup -type=mx google.com

Lookup for an mx record. MX (Mail Exchange) maps a domain name to a list of mail exchange servers for that domain. The MX record says that all the mails sent to “google.com” should be routed to the Mail server in that domain. 

nslookup -type=mx google.com

Nslookup Command in Linux with Examples

Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from the DNS server. It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or any other specific DNS record. It is also used to troubleshoot DNS-related problems.

In easy words, imagine the internet as a giant neighborhood. Websites are like houses, but instead of street names, they have easy-to-remember addresses like “google.com”. However, computers communicate using numbers, so they need a way to find these houses. That’s where DNS comes in. It acts like a phonebook, translating those friendly website names into numerical addresses (IP addresses) that computers can understand.

Now, the nslookup command is like a special tool you can use to explore this phonebook. It lets you ask questions about websites and how they’re connected. You can use it to:

  • Look up a website’s address: Just like looking up a phone number in a phonebook, you can use nslookup to find the IP address of a website.
  • Troubleshoot problems: If you’re having trouble accessing a website, nslookup can help you pinpoint where the issue might lie.
  • Learn more about domain configurations: By using nslookup, you can discover details about a website’s domain, such as the servers responsible for managing it.

Similar Reads

Syntax of the nslookup Command in Linux

The syntax of the nslookup command is relatively straightforward, typically taking the form:...

Options of nslookup command:

Options Description -domain=[domain-name] allows you to change the default DNS name. -debug enables the display of debugging information. -port=[port-number] Use the -port option to specify the port number for queries. By default, nslookup uses port 53 for DNS queries -timeout=[seconds] you can specify the time allowed for the DNS server to respond. By default, the timeout is set to a few seconds -type=a Lookup for a record We can also view all the available DNS records for a particular record using the -type=a option -type=any  Lookup for any record We can also view all the available DNS records using the -type=any option.  -type=hinfo  displays hardware-related information about the host. It provides details about the operating system and hardware platform -type=mx   Lookup for an mx record MX (Mail Exchange) maps a domain name to a list of mail exchange servers for that domain. The MX record says that all the mails sent to “google.com” should be routed to the Mail server in that domain.  -type=ns Lookup for an ns record NS (Name Server) record maps a domain name to a list of DNS servers authoritative for that domain. It will output the name serves which are associated with the given domain.  -type=ptr  used in reverse DNS lookups. It retrieves the Pointer (PTR) records, which map IP addresses to domain names. -type=soa Lookup for a soa record SOA record (start of authority), provides the authoritative information about the domain, the e-mail address of the domain admin, the domain serial number, etc…...

Performing a basic DNS lookup

Syntax:...

Performing a reverse DNS lookup

Syntax:...

Using `-type=any` option

Syntax:...

Using `-type=soa` option

Syntax:...

Using `-type=ns` option

Syntax:...

Using `-type=a` option

Syntax:...

Using `-type=mx` option

Syntax:...

Using `-type=txt` option

Syntax:...

Nslookup Command in Linux – FAQs

What is nslookup command used for?...

Conclusion

In this article we have discussed the `nslookup` command which is a variable tool for querying the DNS server and obtaining information about domain name or IP address mapping. We have studied that it is very useful for troubleshooting DNS-related issues. We have also discussed options like -type=a, -type=any, -type=mx, -type=ns, -type=ptr, and -type=soa. Overall, we can say that by using nslookup information, administrators can gain insights into the DNS infrastructure and resolve DNS-related problems efficiently....