Can't connect local server by public domain name

horejsek

I have my server (Debian Wheezy) in my local home network. On that server I have my own DNS server (dnsmasq) for other local servers (so I can type name instead of local IP) and reverse proxy (nginx). On my router I configured forwarding of 80 & 443 ports to my reverse proxy and everything works just great. But only from outside of my network.

When I type myaddress.com registered in public DNS servers somewhere else, it's fine. But when I type it from my local address, I got nothing. I can access it only by typing local name or IP. By nothing I mean "no data received". For example:

$ wget myaddress.com
--2016-06-01 19:53:46--  http://myaddress.com/
Resolving myaddress.com... 80.243.xx.yy
Connecting to myaddress.com|80.243.xx.yy|:80... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

But when I access it by local IP:

$ wget myaddress.local
--2016-06-01 19:57:13--  http://myaddress.local/
Resolving myaddress.local... 192.168.0.111
Connecting to 192.168.0.111... connected.
HTTP request sent, awaiting response... 200 OK

In nginx log I can see that request was received and also it responded. So I used tcpdump to check out what's happening. Normal dump when accessing from outside my network:

19:37:31.455120 IP myphone > mylocalreverseproxy: Flags [P.], seq 1824665393:1824665988, ack 2996933611, win 336, options [nop,nop,TS val 1206547844 ecr 217767803], length 595
E....F..,.)0B.]....e...Pl./1.......P.......
G.u....{GET / HTTP/1.1
Host: myaddress.com
...other headers...

19:37:31.455241 IP mylocalreverseproxy > myphone: Flags [P.], seq 1:725, ack 595, win 55, options [nop,nop,TS val 217767807 ecr 1206547844], length 724
E...L.@.@.._...eB.]..P......l.1....7.......
....G.u.HTTP/1.1 404 Not Found
Server: nginx/1.8.0
Date: Wed, 01 Jun 2016 17:37:31 GMT

And tcpdump when I try access withing local network:

19:35:25.085344 IP localchromebook > mylocalreverseproxy: Flags [P.], seq 0:390, ack 1, win 115, options [nop,nop,TS val 537594624 ecr 217735412], length 390
E...-M@.>..........e...P.v.4...Y...s.......
 .....`.GET / HTTP/1.1
Host: myaddress.com
...other headers...

And nothing. Resp. another try within few moments. And another and so on.

I'm not admin so I'm not sure what to try and where to look next to see whats wrong and fix it. I should note that about year ago it was working just fine but one day it started to do this and I wasn't able to fix it since. What would you recommend to try?

Moshe Katz

Your router likely doesn't support "NAT Reflection", also called "Hairpin NAT" or "NAT Loopback".

This means that the requests to your public IP address from inside your own network are either not sent to the server at all or are sent to the server with the wrong "Respond-to" IP address, causing "Triangular Routing" which your computer can't handle.

Your router may have a setting that allows you to turn on NAT Reflection. Otherwise, the only way to solve this is with "Split DNS" - setting up DNS in your network to return your server's private IP instead of its public IP.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't connect to MySQL server on (ip or domain name)

From Dev

Can't connect to MySQL server on (ip or domain name)

From Dev

Can't connect on local server

From Dev

mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'domain name' (111)

From Dev

Can't connect to MySQL server on 'domain' (111)

From Dev

Can't connect to MySQL server on 'domain' (111)

From Dev

connect to local, public mysql server

From Dev

Can't connect to local MySQL server

From Dev

can't resolve local domain name with bind9

From Dev

Why can't I connect to server via actual public IP?

From Dev

Why can't I connect to server via actual public IP?

From Dev

apache - Can't connect to apache local server between ubuntu and android

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

PrincipalContext - I Can't connect to a local openldap server

From Dev

I can't connect to test a local server started with TcpListener

From Dev

PHP can't connect to local MariaDB server using TCP

From Dev

Can't connect to rumpus server via local IP on macbook pro

From Dev

Can't connect to local Sql Server while connected to a VPN

From Dev

Can't connect to web-server on local host behind NAT

From Dev

Why it can't connect to local mysql server due ERROR 2002?

From Dev

tcp client can't connect to local server randomly in unity

From Dev

Minecraft for Windows 10 can't connect to local server on LAN

From Dev

Can't connect to local MySQL server through socket

From Dev

"Can't connect to local MySQL server" in docker-compose

From Dev

How can I access my nodejs web server from my local computer using the server domain name?

From Dev

Can't connect to my public IP from other machine in same local network

From Dev

Can't connect to local Datastore

From Dev

Let's Encrypt for a local server with a public reachable domain

From Dev

SQL Server 2014- can't connect to local db - can not find server

Related Related

  1. 1

    Can't connect to MySQL server on (ip or domain name)

  2. 2

    Can't connect to MySQL server on (ip or domain name)

  3. 3

    Can't connect on local server

  4. 4

    mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'domain name' (111)

  5. 5

    Can't connect to MySQL server on 'domain' (111)

  6. 6

    Can't connect to MySQL server on 'domain' (111)

  7. 7

    connect to local, public mysql server

  8. 8

    Can't connect to local MySQL server

  9. 9

    can't resolve local domain name with bind9

  10. 10

    Why can't I connect to server via actual public IP?

  11. 11

    Why can't I connect to server via actual public IP?

  12. 12

    apache - Can't connect to apache local server between ubuntu and android

  13. 13

    "Can't connect to local MySQL server" in docker-compose

  14. 14

    PrincipalContext - I Can't connect to a local openldap server

  15. 15

    I can't connect to test a local server started with TcpListener

  16. 16

    PHP can't connect to local MariaDB server using TCP

  17. 17

    Can't connect to rumpus server via local IP on macbook pro

  18. 18

    Can't connect to local Sql Server while connected to a VPN

  19. 19

    Can't connect to web-server on local host behind NAT

  20. 20

    Why it can't connect to local mysql server due ERROR 2002?

  21. 21

    tcp client can't connect to local server randomly in unity

  22. 22

    Minecraft for Windows 10 can't connect to local server on LAN

  23. 23

    Can't connect to local MySQL server through socket

  24. 24

    "Can't connect to local MySQL server" in docker-compose

  25. 25

    How can I access my nodejs web server from my local computer using the server domain name?

  26. 26

    Can't connect to my public IP from other machine in same local network

  27. 27

    Can't connect to local Datastore

  28. 28

    Let's Encrypt for a local server with a public reachable domain

  29. 29

    SQL Server 2014- can't connect to local db - can not find server

HotTag

Archive