Sendmail and multiple domains
I am trying to setup two CMS based sites on my server, both require access to sendmail so as people can verify by email.
My problem being to my knowledge and research you can only have one FQDN per machine/vps, I am trying to set this up so as when a mail server does an MX/RDNS query to see if the FQDN matches the doman in the email the mail does not get thrown out as spam.
So I guess I am asking is there some way to make a machine appear to have multiple FQDN's? If so, how is it done?
12 Replies
You set up one rDNS entry, you make sure that there is an A record that matches, and you make sure your mail server announces itself by that name. Any domains you are sending for that use SPF must include that server's IP address. That's all there is to it.
@Stever:
The domain name of the server does not need to match the domain name of the email address. One server (with one name) can send out mail for any number of email domains.
You set up one rDNS entry, you make sure that there is an A record that matches, and you make sure your mail server announces itself by that name. Any domains you are sending for that use SPF must include that server's IP address. That's all there is to it.
Awesome, that's great news, but in my travels I have not found any info on how to do what you are suggesting, do you have any links or advice on how to go about it?
I have the rdns setup, that's no problem, but I can't find anything on how to setup sendmail in the manner you are mentioning.
this
@Stever:
If you've set up your system with the correct FQDN, then you probably don't need to do anything special to get sendmail to use it. I've never used sendmail (well, not in the last 15 years at least), but
might be what you need if the system's FQDN isn't set correctly or isn't what you want to use for the mailserver. this
Hey..
One FQDN is set correctly, but I need to setup another domain on the same IP, so obviously there I can't have two FQDN's on the same IP if everything of what I read is correct. So what I need to know is how to configure the server to answer an RDNS as the secondary name so it will respond with the secondary domain if requested.
EDIT: It also seems you may have a misconception that FQDN means there is rDNS - it does not mean that. A FQDN just means the whole host/domain name, like mail.example.com.
@Stever:
A server can only have one reverse name, and that is the one you should use for the mailserver hostname. It doesn't really matter if that name is related to the email you are sending. The only time that is a problem is if you don't want that particular name associated with the mail you are sending, since it will appear in the headers when someone receives the email. So you might not want to use mail.mypornsite.com as the reverse name for a server that's going to handle email you send to grandma.
EDIT: It also seems you may have a misconception that FQDN means there is rDNS - it does not mean that. A FQDN just means the whole host/domain name, like mail.example.com.
What you just mentioned is exactly what I am trying to avoid, I don't want anything to do with one websites emails to have a single thing on it about the other site, be it mail server name headers etc.
@Stever:
A server can only have one reverse name, and that is the one you should use for the mailserver hostname. It doesn't really matter if that name is related to the email you are sending. The only time that is a problem is if you don't want that particular name associated with the mail you are sending, since it will appear in the headers when someone receives the email. So you might not want to use mail.mypornsite.com as the reverse name for a server that's going to handle email you send to grandma.
EDIT: It also seems you may have a misconception that FQDN means there is rDNS - it does not mean that. A FQDN just means the whole host/domain name, like mail.example.com.
What you just mentioned is exactly what I am trying to avoid, I don't want anything to do with one websites emails to have a single thing on it about the other site, be it mail server name headers etc.
@jamesb:
What you just mentioned is exactly what I am trying to avoid, I don't want anything to do with one websites emails to have a single thing on it about the other site, be it mail server name headers etc.
The best you can do then it to use something suitably generic for the mailserver name. For example, google handles mail for thousands (millions?) of organizations, and uses names like "exprod6og110.obsmtp.com" for their outgoing servers.
@Stever:
@jamesb:What you just mentioned is exactly what I am trying to avoid, I don't want anything to do with one websites emails to have a single thing on it about the other site, be it mail server name headers etc.
The best you can do then it to use something suitably generic for the mailserver name. For example, google handles mail for thousands (millions?) of organizations, and uses names like "exprod6og110.obsmtp.com" for their outgoing servers.
Yeah.. I'm really a long way of understanding how to implement this, last time I changed the server hostname to something other than my main domain anything sent out from the server wound up in spam bins, I need to avoid this at all costs, I also can't afford to buy another domain to make things generic to make things come from an FQDN as seems to be a need so as emails dont wind up in spam boxes.
@jamesb:
I need to avoid this at all costs, I also can't afford to buy another domain
"at all costs" doesn't cover <$10/year for another domain name?
In this example we will use 10.10.10.10 and 10.10.10.11 for our IP addresses, that way if someone copies this example into a real DNS server, we won't break things. Use the one that is assigned to your linode.
Edit /etc/bind/db.example.com
$TTL 86400
$ORIGIN example.com.
@ IN SOA ns1.example.com. dns.example.com (
2007123101
2H
15M
1W
1D )
IN NS ns1.example.com.
IN NS ns2.example.com.
IN A 10.10.10.10
IN MX 10 server.example.com.
server.example.com. IN TXT "v=spf1 a -all"
ns1 IN A 10.10.10.10
ns2 IN A 10.10.10.11
server IN A 10.10.10.10
www IN A 10.10.10.10
mail IN CNAME example.com.
ftp IN CNAME example.com.
example.com. IN TXT "v=spf1 a mx ~all"
Setup the zone file for any hosted domains
The zone file for hosted domains will all be similar in this case, with only the domain names changing. Girlie's zone file is below. Littleone's will be the same with example.org substituted for example.net
$TTL 86400
$ORIGIN example.net.
@ IN SOA ns1.example.com. dns.example.com (
2007123101
2H
15M
1W
1D )
IN NS ns1.example.com.
IN NS ns2.example.com.
IN A 10.10.10.10
IN MX 10 server.example.com.
www IN A 10.10.10.10
mail IN CNAME example.net.
ftp IN CNAME example.net.