Forcing Exim to do DNS lookup even for hosted domains

roel

Verified User
Joined
Oct 13, 2004
Messages
31
Hi,

On our DA server, we don't actually use the nameserver.

We currently have e-mail hosting for a number of domains on another server. Now, this poses a problem with web forms that point to e-mail adresses for these domains, as Exim assumes that the domain mail is hosted locally. Is there any way I can force Exim to always do a DNS lookup (on a remote DNS server) for sent mail?
 
I'm answering a bit out of order; hopefully it will make my response clear...
roel said:
Is there any way I can force Exim to always do a DNS lookup (on a remote DNS server) for sent mail?
Exim must know domains for which it hosts email from domains for which it doesn't host email, and for those domains for which it hosts emails it will always do a local delivery.

However all is not lost.

Logged in to DA's user level you can, under Email Management | MX Records, uncheck "Use this server to handle my emails" and then change the MX record to point to the real nameserver. What you've just done is told exim that the email is NOT being hosted locally, and it will do a DNS lookup.
On our DA server, we don't actually use the nameserver
Are you sure you don't use it? For example, if it's listed in /etc/resolv.conf, either as localhost, or as 127.0.0.1, or it's real IP#s, then you DO use it.

If you do use it you can stop using it by putting the IP#s of two other recursive nameservers you have permission to use (and which are fast, so hopefully they're on your local network) in instead of the pointers to the server's nameserver.

Once you really don't use the nameserver for anything, you can stop it. Here's how I'd stop it:

Because DirectAdmin will always try to restart bind, just stopping it from the shell won't work; it'll restart within a minute.

You can turn it off in the Control Panel; that should work. But there's always a chance another admin or a reboot will turn it back on.

So what I like to do is change the name of the binary file to save it on the server, and then to replace the named binary file with another. On my testbed server (running wbel), doing

# whereis named

returns:

/usr/sbin/named

So if I want to disable named, I rename it:

# mv /usr/sbin/named /usr/sbin/named-disabled

Then I'd create a new file at /usr/sbin/named, giving it the same attributes and ownership as named-disabled.

Here's what I'd put into the new file:
Code:
#!/bin/bash
exit 0

Now test your work by running:

# /etc/rc.d/init.d/named restart

and make sure that

# ps waux | grep named

returns either nothing or one grep line.

Then if an admin or a reboot tries to turn it back on, nothing will happen.

Jeff
 
Wow. That's pretty much the exact info I needed, thanks a lot!
 
Back
Top