Hi,
I'm trying to connect to my domain name "www.example.com " from inside the LAN but it fails. But it works fine if i'm not connected to the LAN.
For example:
my external IP is 3.3.3.3
my domain name www.example.com resolves to this 3.3.3.3 ip address.
Inside the LAN the webserver is at 192.168.1.3 port 8080
I have a port forward for anything coming in the WAN on port 80 -> 192.168.1.3:8080
When i access www.example.com from my cell phone with wifi turned off it works fine.
When i enable wifi on the cell phone and i'm connected to the LAN and i attempt to connect to www.example.com domain it times out.
What is the best way to resolve this?
It worked on the stock netgear firmware.
Thanks.
i guess you should try to use www.example.com:8080 or LAN-IP:8080 when accessing from the LAN side ?
that gives me a connection refused error.
Rebind the domain name to the server LAN IP:
https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#hostnames
And make sure to specify its LAN port in the URL.
1 Like
Unfortunately i still get a connection refused. Here is what was added to /etc/config/dhcp
config domain
option ip '192.168.1.3'
option name 'www.example.com'
And from browser i tried to access: http://www.example.com:8080
1 Like
Verify that your LAN IP range is not filtered in the web server config.
It's not i can access it directly at http://192.168.1.3:8080 (although it brings me to the root website since it's missing the domain name header)
Each site in httpd typically has a separate config which can use a different set of allowed IPs.
did you restart dnsmasq afterwards ?
1 Like
I'm actually using nginx inside a docker container on a different server not httpd.
Yes i restarted dnsmasq, but I have dns setup to use google DNS.
I since the hostname is resolving to the external IP, I guess the real problem is how to use external IP address from inside the network.
set a rule on the outgoing traffic, to redirect to 192.168.1.3, or change the DNS.
1 Like
So in Luci, under interfaces->devices -> "br-lan" device, when i check the box for "promiscuous mode" then it works.
Is there any downsides to enabling promiscuous mode on the br-lan?
1 Like
This just worked for me too, thanks for posting!
I have a few needs for accessing my home-hosted server by the domain name, while inside my LAN, and setting br-lan promiscuous mode to enabled fixed this issue.
Many thanks, Scott.
system
Closed
September 16, 2024, 7:28am
14
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.