Troubleshooting 'unable to get mx info: failed to get IPs from PTR record: lookup <nil>: unrecognized address' error

Issue

unable to get mx info: failed to get IPs from PTR record: lookup <nil>: unrecognized address

This error means that SendGrid was unable to find an MX record or A record when looking up the recipient domain in order to deliver the email. 

MX (Mail Exchange) records are necessary to send emails because they play a critical role in the email delivery process. When you send an email to someone, the email needs to be routed to the correct mail server responsible for handling incoming emails for the recipient's domain. MX records are DNS (Domain Name System) records specifically designated to identify the mail servers responsible for receiving emails for a domain.

Let's break down the error message:

  • "Unable to get MX info": This means that the system or application was unable to obtain the MX record information for the specified domain.

  • "Failed to get IPs from PTR record": The error suggests that there might be an issue with obtaining IP addresses from the PTR (Pointer) records. PTR records are used to map IP addresses to domain names.

  • "Lookup <nil>: unrecognized address": This part of the error message indicates that there was an issue with the lookup process, and it resulted in an unrecognized or nil (null) address.

Product

Twilio SendGrid Email

Cause

  • DNS Configuration: The DNS configuration for the domain might be incorrect or missing. Ensure that the domain has valid MX records, and they are correctly set up to point to the correct mail servers.

  • PTR Record: The error message indicates a problem with PTR records, which are related to reverse DNS lookups. PTR records are typically managed by the owner of the IP address range, not the domain owner. However, it's essential to have properly configured PTR records to avoid issues with email delivery. If you are not the owner of the IP address range, you may need to contact your internet service provider or the responsible party to check and fix the PTR records.

  • Temporary DNS: Sometimes, DNS lookups can fail due to temporary network or DNS server issues. Try again later to see if the issue persists.

  • Software or Application: The error may be specific to the application or tool customers are using to query the MX records. Ensure that the application is correctly configured and up-to-date.

Resolution

To diagnose the issue further, you may want to use standard command-line tools like nslookup or dig to manually query the MX records for the domain in question. 

nslookup -type=mx example.com

For example, using the above command in the terminal you can see how the results look like on a domain that has MX and no MX records.

# For the domain sendgrid.com (that has valid MX records)

nslookup -type=mx sendgrid.com

Server: 192.168.1.1

Address: 192.168.1.1#53


Non-authoritative answer:

sendgrid.com mail exchanger = 10 mxa-0023de01.gslb.pphosted.com.

sendgrid.com mail exchanger = 10 mxb-0023de01.gslb.pphosted.com.

# For the domain aboutpriya.com (that has no MX records)

nslookup -type=mx aboutpriya.com (That has no MX records)

Server: 192.168.1.1

Address: 192.168.1.1#53


** server can't find aboutpriya.com: NXDOMAIN


You can also use a third party tool like MXToolBox where you confirm that an address has valid MX record installed.

If you are still unable to resolve the issue, consider seeking assistance from the recipient domain administrator or their IT support team to investigate and troubleshoot further.

Additional Information 

Note: Other senders such as Outlook/Gmail may not require recursive lookup in order to deliver mail. This explains why it is sometimes possible to send emails from different senders and not from SendGrid. Gmail/Outlook is likely relying on cached information from their end in order to deliver the email. However, SendGrid does not and cannot rely on cached information and requires recursive lookup. Until the recipient domain allows for recursive lookup and provides an authoritative A record, you will see delivery issues.

Have more questions? Submit a request