How to access the site by domain name if website is located in the locale server

Started by James Fisher, Nov 30, 2022, 10:42 AM

Previous topic - Next topic

James FisherTopic starter

Actually, the question is, we are making a web site, the server is located in our local network, we have screwed the domain there.
Everything works through a proxy, but does not go directly. Where to dig?

UPD.
Registered the domain. Through Google DNS, they screwed to a white ip through a firewall redirects to the local PC where the site lies.
There is a domain controller with a DNS server, added an entry there to the direct inspection zones (domain name -> local IP of the site) - does not work.
  •  

rabindra

What do you mean screwed? A-record with a local IP?

According to the description of the problem, it looks like you have the 80th port from the router to the server. You have added an A record with the router's external address. And you are trying to get to it from the locale.
In this case, the redirection works before NAT, and since the redirection goes to the local network, the rule for NAT does not work at all, the server receives a packet from the local machine and responds to it, and the local machine waits for a response from an external IP, not the local address of the server.
  •  

rickymartin

Since Apache listens to all network interfaces by default and responds to all, we can assume that if we enter a global address in a web browser, we will see our website.
If the Internet service provider's cable is connected to your computer directly, then access by IP address will probably work (there are nuances with NAT).

But if you use a router, then the IP address belongs to the router. If a request comes from the Internet to the router, then it simply does not know which device in the local network to forward this request to.
Moreover, most routers have their own web server - it shows pages with router settings in a web browser.

Therefore, in order for your local site to start being visible on the Internet, you need to configure port forwarding.
Port forwarding is available for LAN settings and for Internet connection settings - we need exactly the latter.
In the router, go to the Internet settings, find port forwarding there. Some routers support Port switching – this will not work for us.

Select 80 as the port for forwarding, enter the local IP address of the computer hosting the web server and enter the port to which the forwarding will take place – 80, protocol – TCP.
  •