Domain / IP within LAN

Soldato
Joined
21 Jul 2004
Posts
6,360
Location
Harrow, UK
On my LAN, all devices have an IP of 192.168.1.x and and some of these devices constantly update some Dyn domains with the public IP.

Within the LAN I could connect to my PC's VNC server by using:
192.168.1.2:5900
or
xxxx.mine.nu:5900

Now my question is, would the second one actually go via the internet. It will to obviously resolve the IP etc but would the network be clever enough to figure out that it is actually internal?
 
Assuming the port is forwarded to the device, then yes the second one will connect to the device via the internet.
 
If I understand correctly and DNS xxxx.mine.nu resolves to 192.168.1.2 then it would stay on the 192.168.1.x subnet, the port is irrelevant since you are only routing at the network layer and the computer will know both devices are on the same subnet so wont forward to the router/internet
 
Does your router support NAT loopback?

I'm not sure... I have the Asus RT-N66U running the latest Shibby Tomato firmware.

If I understand correctly and DNS xxxx.mine.nu resolves to 192.168.1.2 then it would stay on the 192.168.1.x subnet, the port is irrelevant since you are only routing at the network layer and the computer will know both devices are on the same subnet so wont forward to the router/internet

The DNS resolves to the public IP (Virgin Media) and not a LAN IP.
 
If your router supports NAT loopback then it will realise that the connection need to go back through the LAN interface (terrible explanation but you get the idea) and work. If it doesn't support loopback then the connection will fail as it will try to connect to port 5900 on your router.

It won't ever go out to the internet and come back in, only the DNS request will. Loopback is a pain though and generally more trouble than it's worth, you're better off running your own DNS server inside the LAN and adding a zone for the domain you want to resolve. I don't know what your router can do though.
 
Last edited:
Back
Top Bottom