0

I have personal webserver with ownCloud installed. This webserver has no public IP address because my internet connection does not offer it. I ordered virtual linux webserver with a public IP address and I use it just for port forwarding via SSH to allow my ownCloud server be accessible from the internet. Everything works fine and I am accessing the ownCloud via a hostname - example: "mytunneledowncloud.com".

But as I have limited high speed data on my internet connection, I would like to save some data by synchronizing ownCloud via LAN private IP address when I am at home and not via ssh tunneled public ip address of my virtual server. I am thinking whether this is even possible. I would need to resolve "mytunneledowncloud.com" as:

  • private ip address - in case I am on home LAN
  • public ip address - in case I am not on home LAN

To be honest, I know this is a bit "ridiculous" request, but maybe there is some "workaround" for it.

Note: I use Ubuntu on all my servers and PCs.

1 Answer 1

0

Finally I got the resolution for the "problem" and it is very simple. I followed these steps:

  1. installed dnsmasq on my home server so it will become a very simple dns server
  2. in my home server I added an entry with the private ip address of my home server into /etc/hosts with domain name "mytunneledowncloud.com"
  3. configured my home server's DHCP daemon to assign home server's private IP as a DNS server to the clients

Now it works perfectly. My home server now acts as dhcp/dns/web server and it assigns its own private ip as a dns server to the connected LAN clients. Then clients send the requests for the DNS resolution to my home server. My home server's dnsmasq looks into its /etc/hosts whether there is an entry for the requested domain name and if there is a match, provide the IP from there and if there is no match, then it uses the "internet's" DNS servers to resolve it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .