DNS MX Record Enumeration with the host Command

PT0-003 By islever Editorial Last updated

Given a scenario, apply enumeration techniques. Given a scenario, apply information gathering techniques.

Short answer

B The host -t mx example.com command queries DNS for Mail Exchange (MX) records, identifying the mail servers responsible for accepting email for the domain.

Question

A tester runs the command: host -t mx example.com. What information is being gathered?
  1. The IP address of the web server
  2. The Mail Exchange servers for the domain Correct Answer
  3. The DNS nameservers for the domain
  4. The TXT records for SPF configuration

Key Takeaways

DNS MX record enumeration uses the host -t mx command to identify the mail servers responsible for accepting email for a target domain. Option B is correct because the -t mx flag specifically queries Mail Exchange records, mapping the email infrastructure for potential SMTP-based attacks. Other DNS record types, such as A, NS, or TXT, resolve web servers, nameservers, or SPF configurations respectively.

Expert Analysis

The host -t mx command queries DNS for Mail Exchange (MX) records. These records identify the mail servers responsible for accepting email for the domain. This information is valuable for understanding the email infrastructure and potential attack vectors.

Specifying the -t mx argument within the host utility explicitly restricts the DNS query to the Mail Exchange record type for the example.com namespace. Option B correctly identifies this outcome, as the MX record is the standard DNS mechanism used to route inbound SMTP traffic to the specific mail servers authorized to accept messages on behalf of the domain. By retrieving this data, a penetration tester maps the email infrastructure, which may reveal targets for SMTP banner grabbing, user enumeration via SMTP commands like VRFY or EXPN, or phishing campaign infrastructure. Understanding where inbound mail is processed provides a direct path to identifying the edge appliances protecting the corporate environment, such as Proofpoint, Mimecast, or Microsoft Exchange Online Protection.

Option A fails because retrieving the IP address of a web server requires querying an A (IPv4) or AAAA (IPv6) record. A tester would execute host example.com or host -t a example.com to resolve the web server's IP address. The mx type explicitly excludes address records and focuses solely on mail routing. Option C fails because DNS nameservers are mapped using NS records. To discover the authoritative nameservers for the domain, a tester would use host -t ns example.com. Option D fails because TXT records, often used for SPF configuration, are queried using host -t txt example.com. While SPF records do relate to email security, they define authorized sending IP addresses and servers rather than the receiving mail exchange servers. Confusing MX and TXT records is a common error, as both touch email infrastructure, but MX dictates where mail goes, while SPF dictates which servers are allowed to send mail from the domain.

A critical mechanism underlying this DNS query is the preference priority value attached to MX records. When a domain configures multiple MX records, DNS returns each mail server alongside a priority integer. A lower integer indicates a higher priority, meaning the sending mail transfer agent will attempt delivery to the lowest-priority-value server first. For example, a query against example.com might return mail1.example.com with a priority of 10 and mail2.example.com with a priority of 20. During reconnaissance, a tester prioritizes the server with the lowest priority value, as it is the primary receiving server and the most active target for SMTP-based enumeration. Secondary servers with higher priority values are only engaged if the primary server is unreachable, but they often represent softer targets with weaker banner restrictions or less aggressive rate limiting. Identifying these fallback servers provides alternative entry points if the primary mail gateway blocks scanning attempts.

Official Reference

These links open the official vendor documentation in a new tab.

Exam Strategy

When analyzing DNS enumeration commands on the PT0-003 exam, focus on the specific record type requested by the -t flag. Map the record abbreviation directly to its function: A for IPv4 addresses, NS for nameservers, TXT for text records like SPF, and MX for mail exchange servers. If the command includes -t mx, immediately eliminate any option that does not explicitly mention mail servers or email infrastructure, as the query strictly returns routing information for inbound SMTP traffic.

Practice All PT0-003 Questions

Access 120 questions with complete answers and detailed explanations.

View Full PT0-003 Practice Test →

← Back to PT0-003 Study Guide