Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: tinusje on March 26, 2012, 10:50:49 PM
-
Hi there,
I want to access my SME mail on my mobile device. This device tries to establish a WIFI connection when I'm at home, otherwise it will have a 3G connection.
My problem is this: when I'm on 3G, www.mydomainname.nl resolves to my global IP address, which is good.
However, when I'm on WIFI, I want www.mydomainname.nl to resolve to my local IP address, in my case 172.19.x.y.
I tried to modify etc/hosts ,this doesn't work. On top of that, any changes to this file will be overwritten at restart, as is clearly stated in this file.
Can someone point me in the right direction?
Thanks in advance,
Martijn.
-
My problem is this: when I'm on 3G, www.mydomainname.nl resolves to my global IP address, which is good.
However, when I'm on WIFI, I want www.mydomainname.nl to resolve to my local IP address, in my case 172.19.x.y.
This should "just happen", if you are using your SME server as the DHCP server on your LAN. Alternatively, if the DHCP server on your wireless router is enabled, make sure that your SME server is listed as the only DNS server in your router's configuration.
-
Thanks for your response Charlie,
My SME server isn't the DHCP server, my router takes care of that.
On a windows machine a ipconfig /all shows that my SME is actually the only DNS server, so I guess my router has been configured correctly.
I'll look into the router settings once more to make sure that there's no error.
The strange thing is: when I open a terminal on SME and type PING www.mydomainname.nl my internal IP shows up.
When I do the same thing on any device on my network, my external IP shows up.
Martijn.
-
configure your SME to be the dhcp server
-
I'm sorry, can't do that.
There are about 8 devices connected to my network, I want them to remain connected to the internet whenever my server is down.
It shouldn't make a difference anyway. SME is the only DNS.
-
It shouldn't make a difference anyway. SME is the only DNS.
well, it doesn't seem so..
configure your router to use SME as dns server
-
I'll give it a try, and let you know what the results are.
-
There are about 8 devices connected to my network, I want them to remain connected to the internet whenever my server is down.
How do these devices resolve DNS queries when your SME is down ?
(I suspect when you find the answer to this you will also find the answer to your primary problem)
-
Thanks p-jones,
I'll investigate this later today.
Regards,
Martijn
-
If you have a DD-WRT router you could use DNSMasq options.
http://www.dd-wrt.com/wiki/index.php/DNSMasq_-_DNS_for_your_local_network_-_HOWTO#2.29_Additional_DNS_Options
address=/www.mydomainname.nl/172.19.x.y.
I've added an dyndns adress for those smartphones to resolve to my mailserver, internally to 192.168.x.y, externally to the public IP.
-
Solved!
I edited some settings in my router, now my SME is the first entry in DNS settings.
After refreshing my network connection and flushing local DNS cache my domain name now points to my internal IP when I'm on WIFI.
Thanks all of you for any suggestions!
Regards,
Martijn
-
I edited some settings in my router, now my SME is the first entry in DNS settings.
You will get unreliable results unless you set it as the only entry.
-
Thanks Charlie,
The only reason for me to have multiple DNS entries is that whenever SME is down, the other DNS will take over.
Isn't this how primary and secundary DNS's are supposed to work?
Why will setting a secundary non-SME DNS give me unreliable result?
Regards,
Martijn.
-
Isn't this how primary and secundary DNS's are supposed to work?
In general, no. "primary" and "secondary" doesn't usually apply - resolvers usually just choose one at random from the list available. But it depends on the operating system and the resolver code used by particular programs.
-
Ok, thanks.
I'll remove the second DNS entry whenever I run into problems resolving my domain name.