Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Is it possible to configure sendmail to use the hosts and resolv.conf files other then the ones located in /etc/?

share|improve this question
What are you trying to accomplish? Are you trying to specify a different destination for a particular domain? – ewwhite Oct 26 '10 at 9:57
@ewwhite: No, I just want sendmail to use other DNS servers then the ones specified in /etc/resolv.conf. I'm a developer working on an embedded platform. The system itself is a huge pile of loosely coupled apps and no one knows what programs will modify the /etc/ files any more. So I want to have special copies of these files just for sendmail. Don't bash me if that's a stupid question - I don't usually do stuff like that and had my first contact with sendmail just yesterday... – user58292 Oct 26 '10 at 10:04
An embedded system where you can't trust your own /etc? Not trying to #bash you here, but get a #grep on your platform. :-) If you can't trust something as basic as dns lookups then something else is also bound to break eventually. Then some poor soul will have to wade through your dns hacks looking for the other problem. – Caleb Oct 26 '10 at 11:33
If it were up to me I'd euthanize the platform right away LOL Did I mention the kernel version? Well it's 2.4.29... in the XXI century! – user58292 Oct 27 '10 at 7:38

In short, not that I know of. Most programs use standard system calls for any name resolution and leave the details to the OS.

Now, if you're concerned about people/programs changing file contents, take a look at the chattr command. You can set files such that they can't be overwritten without removing the immutable flag first. It's highly unlikely any program will be written to do that.

share|improve this answer

One option might be setting up postfix and using transport maps to send email where you want it to go.

Bit much to post all the detail on that as it may not be what you want, but to give you an idea.

transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:   smtp:[]

With this setup you can redirect domain names to wherever you want, regardless of dns on the box.

share|improve this answer

Your Answer


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