DNS (and reverse DNS) issues

Hi, I have gotten my site working on Netlify and using Netlify’s nameservers with MX records being pointed elsewhere. I am finding that my emails are being spammed in gmail which I believe to be a reverse DNS issue.

When I run my domain through a DNS lookup, it returns Netlify’s IP address: 159.65.216.232. However, when I run a reverse DNS lookup using that IP, the same IP is returned rather than my hostname.

Can you explain please? Is there any way to fix this?

@ianlunn Because an external service is handling your e-mail, that is more likely the issue than the setup of Netlify’s name servers. I have several sites set up to use Gmail and I’ve not seen this problem.

It might help if you were able to share your custom domain name, so we could look at your settings, etc.

Hi @gregraven. My domain is ianlunn.netlify.app. Regardless of the email issue, shouldn’t the reverse DNS lookup return the domain for the IP address? That’s something handled by Netlify rather than my email service, right?

@ianlunn We’re going to need your custom domain name. You cannot have e-mail addressbDNS entries for a domain you do not control, such as your ianlunn.netlify.app subdomain.

@gregraven ianlunn.co.uk

@ianlunn OK, I see what’s going on now. You said your MX records were pointed elsewhere, I understood that to mean someplace such as Gmail. When I look at your DNS records, you have:

ianlunn.co.uk. 3599 IN MX 10 mail.ianlunn.co.uk.

Because your apex custom domain is using Netlify for DNS, this means you are trying to get Netlify to be your e-mail server, a service it does not offer.

Hi, @ianlunn, I wanted to reply about the following:

Hi @gregraven. My domain is ianlunn.netlify.app. Regardless of the email issue, shouldn’t the reverse DNS lookup return the domain for the IP address? That’s something handled by Netlify rather than my email service, right?

There is no 1:1 connection between IP addresses at Netlify and custom domains. The relationship is one to many. A small set of IP addresses (each IP address being for a different CDN/ADN node) host all the sites at Netlify.

In other words, each individual IP address can and will handle any/all sites we host. So one IP address connects to millions of custom domains. We don’t have a way to returning a specific custom domain for a single IP address. It just isn’t possible at the DNS level.

Regarding how we know which site to show when you browse a Netlify site (the HTTP level), the web browser (or other tool) will send a host HTTP request header which our CDN/ADN node then use to determine which site to display.

For example, if I make a curl request to https://www.netlify.com/ the header curl sends is this:

Host: www.netlify.com

Our support team can help you get the correct DNS records created at Netlify to get your email service working once you tell us what those correct records are. There is more about migrating from another DNS service to Netlify DNS in this support guide.

However, if your emails requires this reverse DNS lookup our Netlify DNS service won’t do this and won’t ever be able to get that working.

If reveres DNS is a hard requirement for your email service (and I don’t know if that is true or not), I would recommend not using Netlify DNS at all. You can still link the custom domain to the site hosted here using the external DNS instructions.

If there are other questions or concerns, please let us know.

@gregraven It is pointed somewhere else, I also have an A record that points mail.ianlunn.couk to an external IP address.

@luke Thanks for the info. I do already have email working but the issue is that my outgoing email is being spammed in gmail. I’m going to continue investigating and will report back if I’m unable to resolve the issue.

1 Like