Web Hosting Talk







View Full Version : php mail () dns issues?


Buttercup
06-16-2002, 03:48 AM
Me again.

Here's the situation

Have a few servers and with one main server that has about 50 accounts on it and hosts the main site/nameservers. Whenever an account is built on another servers - we add the DNS zone to the main server - that way the nameservers for all clients no matter what server are the same..right?
(long story on that one - it got real ugly there for a bit before we settled on that solution)
anyways.
here's the problem
Theres a php newsletter and forums on the main server - and the forums want to send mail to people that register right? And the newsletter - same thing..Need to verify email addresses by sending an email etc.,etc. Both use the php mail() function..or some such.
However - If the email address is on any of the domains that are on any other server BUT the main server - they dont get it. If the email/domain account is on the main server then it does work. Vice versa as well...if the domain/email account on any other server but the main one with all the DNS zones ..sends an email to an email account on the main server - it doesnt get there...

Bah. Thats confusing again.
Basically -
1. Server 1 has main domain and all dns zones are added to it for nameserver routing for all accounts built on other servers.
2. Server 1 can send mail to anywhere including itself except to accounts on other servers - for eg Server 2.
3. Server 2 cant send mail to Server 1 but can send mail anywhere else.

Any ideas?
TIA

admin0
06-16-2002, 01:01 PM
Hi.

As far as I understand, this has something to do with MX records in the DNS as well as the nameservers pointed in other servers via /etc/resolv.conf. To what I suspect, your main DNS server is what all other servers reflect in /etc/resolv.conf.

1. can you try putting third-party dns servers in /etc/resolv.conf for all the servers ?

2. can you pass some domain names that are giving problems, 2 on main server and 2 on other servers, so that we can lookup the MX records, so that we can proceed further ?


hope this helps.

MotleyFool
06-17-2002, 04:01 AM
Hello

Can you tell us your OS, DNS server [BIND or tinydns or something else] and your MTA?

If you have MX zone records for a domain on server2, even though that server may not be authoritative for that domain, your DNS cache will route it locally

I had this problem when I was moving from a server in nac.net to peak-10.com

I had set up my domain's DNS-to-be on the P10 server and even though I had not changed the authoritative nameservers for my domain, customers on the P10 server mailing me will go to my dummy box @ P10

hope it helps

balaji

WiredMom
06-19-2002, 02:43 AM
We've got that same problem...

If you have 2 servers and are adding the DNS zones to Server A for not only accounts on that server but also the accounts on Server B - is there anything you have to change within the DNS zone for mail - ie the MX records (i guess) for the accounts on Server B?
An IP perhaps? Just guessing there though..:eek:

admin0
06-20-2002, 03:56 AM
Hi.

This is a typical example.... servers A, B and C


Server A: dns, apache, qmail - 192.168.0.1
Server B: apache, qmail - 192.168.0.10
Server C: apache, qmail - 192.168.0.100


Now, we add domainA.com in DNS server.

domainA.com. IN A 192.168.0.1 [for apache]
add entry in apache!
domainA.com IN MX 10 serverA [for email]
add entry in virtualdomains/rcpthosts

Now, we add domainB.com in DNS server.

domainB.com. IN A 192.168.0.10 [for apache]
add entry in apache!
domainB.com IN MX 10 serverB [for email]
add entry in virtualdomains/rcpthosts


Now, we add domainC.com in DNS server.

domainC.com. IN A 192.168.0.100 [for apache]
add entry in apache!
domainC.com IN MX 10 serverC [for email]
add entry in virtualdomains/rcpthosts

Remember, only the domain supposed to take the email must appear in virtualhosts/rcpthosts. If you are using an automatic addhost programme in serverA, then it might be pointing the MX to the same server as the DNS and also adding rcpthosts/virtualhosts entry. Please verify !

Here is a brief outline of the process:

I send domainA an email from my server. My email server requests my dns server to check what the mail server of domainA.com is. My dns server checks for MX record and gives the IP address to my mail server. Then my mail server contacts the mail server pointed for domainA on port25, and says " hey man! i got mail for someone@domaina.com", the mail server then checks its entry in rcpthosts. If the entry is there, he says "yeah! that domain is listed, and I can take this mail", and accepts the email. Now the mail server looks for the domain entry in locals or virtualdomains and deliveres the email accordingly.


Hope this helps.



:D