Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using dynamic DNS both in and out of your LAN

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
fede



Joined: Thu Sep 01, 2005 4:23 am
Posts: 56

PostPosted: Mon Mar 25, 2013 3:23 am    Post subject: Using dynamic DNS both in and out of your LAN Reply with quote

OK, here's my setup: I have a Debian box that acts as a mail and file server in my LAN (one day it will do more, but that's already enough for now). I use it to sync all my computers' main directories, and it also collects (via fetchmail) my mail from my various accounts, so my work computers have their mail clients pointing to my server, and they all get the mail from everywhere.

Now, the problem is to access the server in one way only, whether I am on the LAN or I am out in the wild. Right now, I use hamachi, and it allows me to use their VPN whether I am in or out of my LAN (it's a bit strange to use it from within the LAN, but the point is that it works).

I would like to wean myself from hamachi and use my dynamic DNS address, and port-forwarding (which is active for POP and SSH, for now) to do the same. The problem is that trying to access my public IP from within my LAN does not work, and if I use my LAN address when I am in, and my public IP when I am out, all my computers think I am accessing a different server, so my mail get downloaded twice to my mail clients, which is both a waste of time, and of space.

Is there some kind of workaround for this that is escaping me? Basically, I believe, I would need my mail clients to be able to query my POP server from inside the LAN using the public IP, or something that would emulate this behavior.

Thanks for any ideas!
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Mon Mar 25, 2013 8:46 am    Post subject: Reply with quote

This is quite simple to do, if you are running a local DNS server (and if you are not, read the dnamasq tutorial in LXF 170).

All you do is add the mail server's hostname, along with its LAN IP address to /etc/hosts on the box running dnsmasq. That way the hostname will resolve to the LAN address when at home and the public address when out and about.

That's exactly what I do here, and its worked well for many years.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
fede



Joined: Thu Sep 01, 2005 4:23 am
Posts: 56

PostPosted: Wed Apr 10, 2013 7:00 pm    Post subject: using a DNS server Reply with quote

Thanks! I waited until I got LXF 170 in the mail (I downloaded the PDF version, but I am lazy about reading on a screen Sad )

Just one question (which I should be able to answer myself by experimenting): is it OK if the computer running dnamsq and the mail server are one and the same? I would think so, but I might be missing something.
Back to top
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8457
Location: Warrington, UK

PostPosted: Wed Apr 10, 2013 7:14 pm    Post subject: Reply with quote

It's not only OK, it's how I've been doing it for many years.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast