LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS Issues Between Mail & Web Server (https://www.linuxquestions.org/questions/linux-networking-3/dns-issues-between-mail-and-web-server-854659/)

carlosinfl 01-06-2011 12:10 PM

DNS Issues Between Mail & Web Server
 
Just to set up the environment for you guys (or gals), I'm running a Cisco ASA 5520 Firewall and I've got my web server:

*All domains and external IP's are bogus but lets assume they're valid for the time being.*

www.somedomain.tld
192.168.0.201 (internal)
216.162.100.136 (external)

And my mail server:

mail.somedomain.tld
192.168.0.200 (internal)
216.162.100.135 (external)

Both my mail and web server sit on the same DMZ interface behind the Firewall. I'm having problems sending webmail from the web server because when my www server connects to mail, it does so as the external IP rather than the trusted internal IP. My mail server only relays mail from trusted networks and that's only 192.168.0.0/24.

Code:

Jan  6 12:51:54 mail dovecot: imap-login: Login: user=<carlos>, method=PLAIN, rip=216.162.100.136, lip=192.168.0.200, mpid=4656, TLS
Jan  6 12:51:55 mail postfix/smtpd[4657]: warning: 216.162.100.136: address not listed for hostname www.somedomain.tld
Jan  6 12:51:55 mail postfix/smtpd[4657]: connect from unknown[216.162.100.136]
Jan  6 12:51:55 mail postfix/smtpd[4657]: setting up TLS connection from unknown[216.162.100.136]
Jan  6 12:51:55 mail postfix/smtpd[4657]: Anonymous TLS connection established from unknown[216.162.100.136]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Jan  6 12:51:55 mail postfix/smtpd[4657]: disconnect from unknown[216.162.100.136]
Jan  6 12:51:55 mail dovecot: imap(carlos): Disconnected: Logged out bytes=12/341

So I don't understand why the rip (requested IP) is my external NAT IP rather than my internal 192.168.0.201 IP address. They're both on the same network / subnet so why is my web server going out and back into the Firewall? This makes no sense to me. My mail server doesn't trust the external NAT IP but rather the internal 192.168.0.0/24 subnet. I've check DNS and rDNS and they're all correct. I've added local host entries in my mail server for the web servers 192.168.0.201/24 IP. Anyone know what's going on here?

bathory 01-06-2011 12:36 PM

Hi,

You should go the other way around:
Add in webserver's /etc/hosts the internal IP of the mail server.

carlosinfl 01-06-2011 02:52 PM

Quote:

Originally Posted by bathory (Post 4215505)
Hi,

You should go the other way around:
Add in webserver's /etc/hosts the internal IP of the mail server.

Yes they both have their respective internal IP entries in their /etc/hosts file. Still doesn't make sense or work for me.

bathory 01-06-2011 04:38 PM

You can setup the webmail application to use your mail server's internal IP.

What do the following 2 commands give:
Code:

nslookup mail.somedomain.tld
ping mail.somedomain.tld

The 1st uses dns, while the 2nd uses /etc/hosts. Then check /etc/nsswitch.conf to see if you have "files" before "dns" in the "hosts" line. It could be the reason that the web server box does dns lookups to find the mail server IP.


All times are GMT -5. The time now is 06:37 AM.