You are here: Articles > UNIX > Software

 See more articles about "Software "

Search for mail exchanger (MX) records using dig

 

Mail exchanger or MX records in DNS are used to route email for a domain. The dig utility makes it easy to search for this type of DNS record.

To search for the MX records for the domain tech-recipes.com, use:



dig mx tech-recipes.com



This will query the DNS server configured in your operating system. Often times it is useful to query against a different DNS server. To perform the same query above against the name server ns3.notarealdomain.com:



dig @ns3.notarealdomain.com mx tech-recipes.com

 

Also see ...

DNS/BIND: Create a basic zone file
H3A zone file holds the DNS resource records for all of the domain names associated with the zone. Zone files store all of the data served by a DNS server. This recipe describes the basic zone file format without any resource records suitable for any type of zone file./H3PThe zone file needs

DNS/BIND resource record: Address (A) record
H3The address record (A record) maps a hostname and fully qualified domain name with an IP address./H3PTo add the host span style="font weight: bold"chef/span with IP address 192.168.5.100 to the domain tech recipes.com. in the zone file for tech recipes.com, use the following format: br

DNS/BIND resource record: PTR reverse lookup record
H3The PTR (pointer) record maps an IP address to a hostname and fully qualified domain name. Many applications use reverse lookups to identify the domain from which a TCP/IP connection is formed. Best practice for DNS is to create a PTR record for every A record./H3PTo associate the host che

DNS/BIND resource record: routing mail with MX records
H3Proper DNS configuration with MX records is a requirement for routing email for a domain./H3PWhen an email is sent to a domain, the sending mail server performs a DNS query to find the MX records associated with the recipient's domain. MX records have a preference value (numeric from 0 6553

DNS/BIND: set TTL for individual resource records
H3BIND resource records allow an explict TTL value that will override the zone file's TTL for that specific resource record. One use for this is to prevent non authoritative servers from caching these records, perhaps in prelude to changing a server's IP address./H3PTo set the TTL for an addr