We are using an external commercial smtp server for our newsletters (sending them through .NET components), and they offer two smtp URLs - smtp.critsend.com and fast.critsend.com -, and the second one is reserved for sending singular emails, the first one for bulk.
Using nslookup shows that both resolve to the same 4 IP addresses (fast.critsend.com being an Alias).
Question: (how) is it possible for the smtp relay to distinguish between different names? Is there something in the headers that can be compared to host headers in http protocol (I didn't find any intelligible information for a non-sysadmins)?
The reason I'm asking is because we would like to use one of the IPs in our newsletter script (which works) rather than a name (in order to save DNS requests), and we are wondering about potential problems.
The 4 ip addresses you are seeing using nslookup could just be gateway servers for the network using round robin dns for fail over / load balancing.
These gateways will relay to different "back ends", the only way to really be sure if this is occurring is to send test emails to yourself and inspect the email headers (unless they do a good job of purging internal ones), and see the different servers being use to send the emails.
The target server name is not used in the SMTP request. There is no equivalent of the HTTP
Host:
header.If you want to use an IP address instead of a DNS name, I'd recommend that you talk to the email service provider to verify which IP address they'd prefer you to use. (And, for $DEITY's sake, don't hard code the IP address - use a config file or put it in
/etc/hosts
, and verify it again before the next run!)Another way of avoiding multiple hits on your ISP's DNS server would be to set up a local DNS resolver, instead of using your ISP's resolvers.