cancel
Showing results for 
Search instead for 
Did you mean: 

Problem accessing anything using hostname on internal network

medialinx
Interested
Posts: 2
Registered: ‎06-06-2017

Problem accessing anything using hostname on internal network

Hello,

 

I am a business customer and have some IP cameras and a web server located in my office. However, if I try to access any services using my hostname (myname.plus.com) while I am on the office wifi/cabled connection I cannot access them.

 

For example, the IP cameras just refuse to connect.

The webserver seems to connect to something internally as it returns this error (which is not being generated by my web server, so me thinks it is coming from plus net): 403 forbidden, illegal referrer.

 

If I enter my hostname or fixed IP address it brings me to to the home of the router (a TP link one). What would be stopping my machines reaching the correct services? I presume the router if diverting the traffic to itself on the internal network,  but not really sure. Any help is appreciated?

I must add, I can access everything grand externally, just not internally using my static IP address or hostname.

 

Many thanks,

Graham.

6 REPLIES 6
Chris
Legend
Posts: 17,724
Thanks: 599
Fixes: 169
Registered: ‎05-04-2007

Re: Problem accessing anything using hostname on internal network

Can you access the services by using IP and port number when on the internal network?

Former Plusnet Staff member. Posts after 31st Jan 2020 are not on behalf of Plusnet.
Anonymous
Not applicable

Re: Problem accessing anything using hostname on internal network

Hello @medialinx, and welcome to the forums.

To access anything on an internal LAN using an external address you need to resolve that address locally. So if your web server in on 192.168.6.123, and a public IP of 123.123.123.1 and a web URL of http://mysite.com then you need to resolve that address locally to be 192.168.6.123 and not the public one. Most routers don’t like doing what is called double NATting as it makes them sick.

If you’re running Windows you can edit the hosts file found in C:\Windows\system32\drivers\etc with an entry of:

192.168.6.123 mysite.com

The same logic can be applied if you're running Linux / Mac but edit the /etc/hosts file instead.

 

medialinx
Interested
Posts: 2
Registered: ‎06-06-2017

Re: Problem accessing anything using hostname on internal network

Hey Mook,

Thanks for the swift reply 🙂

I have already updated the hosts file as a work around, but that still doesn't fit the Android devices I have (for example for the CCTV system). Do you know of an Android work around that doesn't require rooting a device?

Many thanks,

Graham.

MisterW
Superuser
Superuser
Posts: 11,101
Thanks: 3,388
Fixes: 260
Registered: ‎30-07-2007

Re: Problem accessing anything using hostname on internal network

What you need is a router that supports NAT loopback https://en.wikipedia.org/wiki/Network_address_translation#NAT_loopback . What model router do you have ?

Superusers are not staff, but they do have a direct line of communication into the business in order to raise issues, concerns and feedback from the community.

mssystems
Rising Star
Posts: 282
Thanks: 39
Fixes: 1
Registered: ‎10-08-2007

Re: Problem accessing anything using hostname on internal network

There are lots of ways to resolve this but none of them involve a cheap PoS ISP provided router.

 

Given you are running a web server, depending on exactly what platform it is, you may be able to add a forward DNS service to it and resolve your private addresses on the LAN [split horizon].

 

 

Browni
Aspiring Hero
Posts: 2,580
Thanks: 978
Fixes: 53
Registered: ‎02-03-2016

Re: Problem accessing anything using hostname on internal network

Here's another list of routers supporting NAT loopback, the Plusnet Hub One also supports it.