K
K
kovalr2016-01-28 00:23:04
Domain Name System
kovalr, 2016-01-28 00:23:04

How to set up different domain IP addresses for the local network and the Internet?

There is a domain. Let's say site.ru .
It is necessary to make sure that the user on the local network (local network with Internet access) when opening site.ru goes to the address 192.168.0.100. As soon as the user leaves the local network and joins the Internet, site.ru must switch to an external ip address. Say 2.2.2.2
You need to understand your DNS in the local network and register an A record for site.ru on it. This is clear. Only here is the question. There is a device. Let's say Android. It is connected to WiFi to the local network. The local DNS returned the A record for site.ru as 192.168.0.100. The traffic went to the local area. Then the user turns on GPRS data transmission. Opens site.ru, Android looks into its phone cache, redirects traffic to 192.168.0.100. But the network is no longer local, but global. Accordingly, the site will not open and will give an error. What then? Android will make a request to the provider's DNS GPRS? And the page will open? How long is the local cache stored and how to quickly switch requests?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Dubrovin, 2016-01-28
@kovalr

Make a stub zone for site.ru in the local DNS, change only those records in it that are necessary. You can set the TTL time for these entries to a minimum to avoid long caching.

D
Dmitry, 2016-01-28
@Tabletko

The device's local cache lives for a few minutes, this shouldn't be a problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question