Can't access mailserver internally

ok, so i have a mailserver setup on a laptop acting as an all-in-one server on my home network.

I'm trying to make my life easier by receiving all my mail from within Windows Live Mail. However, when I attempt a connection to pop. mydomain.co.nz, I can't make the connection (just like I can't connect to www.mydomain.co.nz internally without altering my hosts file)

Is there some way that this can be made possible? It really is a pain.

geek_blacklisted2, Jun 27, 3:17 pm

I don't know what mailserver you use. But I use Mercury Mail Transport System and connect via IP address.

geek_r.g.nixon, Jun 27, 3:32 pm

Set up your own DNS server on the lan, and configure DHCP on your router to have internal hosts it. Have the local DNS server resolve all the mydomain.co.nz stuff to the LAN address instead of the real-world address.

geek_little_egypt, Jun 27, 3:33 pm

ah ha i really didn't think that through. I have now typed in my pop and smtp server in using my server's internal ip address and all is well.

thanks for that r. g. & l. e. - for the record i'm using ubuntu svr 10. 04 w/ postfix as the mail server (i believe - could be wrong i've only been in this linux server business for a week)

geek_blacklisted2, Jun 27, 3:50 pm

Install bind9, copy the configuration from your 'outside' DNS server, then change the outside IP address(es) to the internal one. It's the same as putting the internal IP in /etc/hosts except it will just happen automatically, for every machine on your internal network and only when they're on your internal network. As soon as you connect somewhere else (using a normal, outside DNS server) it'll magically go back to using the 'outside' IP addresses again.

geek_little_egypt, Jun 27, 3:58 pm

I already have bind9 installed - I followed the 'perfect server guide' here: http://www.howtoforge.com/perfect-server-ubuntu-10. 04-lucid-
lynx-ispconfig-2

I read from one of the ispconfig developers that for all DNS settings I was to use my external IP address. for everything else I am to use internal IP's.

geek_blacklisted2, Jun 27, 4:07 pm

If it was just the one desktop client connecting to the server you could just slap a line in the hosts file to resolve it. The way little_egypt described would be the correct way however. As he pointed out by altering the hosts file on say a laptop if you were to go on the road you wouldn't be able to connect as it will be trying it connect to the internal server again. If you set up the DNS server it will be able to connect from anywhere. Plus if you were to change addresses for the server etc there's only one change to make on the bind server rather than every client on the LANs host files.

geek_jcmp21, Jun 27, 4:22 pm

@little_egypt - I'd like to say thanks for that tip about bind9, I did as you said and now it couldn't work better.

geek_blacklisted2, Jun 28, 7:39 pm