Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a sendmail server that's doing something funny. (Funny to me anyway)

It's on a RHEL box and there is an application on the same box that sends messages. The messages are set to send to (for example)

to: from:

and I don't get any of the emails. I added an external (gmail) account to the CC and get that email ok. Looking at the header on the email that is received, sendmail is changing the addresses to and respectively.

This is because on our LAN if you ping, you get back through a CNAME record we have set up. We want any "invalid" addresses typed into IE to take you to our home page... so if you ping, you'll go to

How can I modify sendmail to not do it's own DNS lookup on our domains? I did a packet capture on the traffic to verify that's what it is doing. A host file on the local machine has no effect, I'm sure I need to tell sendmail to actually USE the hosts file, or someting. Help is appreciated.

share|improve this question
1 cannot CNAME to, can you? – grawity Mar 3 '11 at 14:12
@grawity I think it's sort of like setting MX to a CNAME. You can't, but not all programs are sufficiently pedantic enough to care. – DerfK Mar 3 '11 at 17:31
@DerfK: No, it's different. Having CNAME and SOA&NS records on the same name causes the name and its target to have differing data. Pointing MX to a CNAME, afaik, is just "not recommended" because of extra DNS lookups (do they even happen when CNAMEing within the same zone?). – grawity Mar 3 '11 at 18:16
You cannot have a CNAME RR for What is the output of host -t any – Mark Wagner Mar 3 '11 at 21:03

What you are asking for is done via the /etc/mail/service.switch file. Its syntax is similar to the nsswitch.conf(5). However, your setup is complex, and flawed if indeed you've used CNAMEs in places you shouldn't have.

share|improve this answer
My service.switch file reads as hosts dns file aliases files The problem with our DNS configuration... for some reason (still tracking this down) there is a record for * pointing to - so if someone tries to go to or, they go to our website. – LVLAaron Mar 7 '11 at 14:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.