Anyone on my internet can't access my self-hosted website
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Anyone on my internet can't access my self-hosted website
Hello and thanks for taking the time to read this, I have a self hosted website running with the LAMP stack and anyone on my internet can not access my webpage but everyone else(the whole world/US that isn't on my internet) can. I have it portforwarded on port 80 and a westell router
yeah you'll need to add a local DNS A record for the LAN that forwards yourdomain.com to the IP of your internal server on the LAN. i had the same problem recently with email running on my LAN
so DNS (domain name system) is how a computer translates a domain name (test.com) into an IP address (12.34.56.789). Every device connected to a network has an IP address, it is analagous to a street address of your house. DNS exists so that people can just type test.com into a web browser (or any other internet-related service) instead of having to remember its IP address.
Your problem here occurs because of how certain types of networks have their addresses configured, and by how the DNS servers of the internet operate. A home network typically has 1 primary router connected to the modem; this router actually has 2 IP addresses, a so-called "internal" one which is usually numbered 192.168.0.1 (but could be different), and an "external" one which is assigned to the router by your ISP. In order for the rest of the world to access your server, you probably added this external address to the config page of whoever you bought your domain name from. But if you are located on the network which has this precise IP address, trying to go to the website by name will fail, because your system
1) does a DNS lookup on yourdomain.com, and receives the external address as a result,
2) attempts to connect to this address, but this address is the same address as the one on your own router. The router doesn't know where to route this request, so gives up.
The solution is to run a local DNS server on the LAN. DNS records, at their most basic, contain 2 bits of information; a domain name, and an IP address. The server stores these records, and any client on the network that submits a request for the IP of yourdomain.com gives them the corresponding IP. You need to have a DNS server for the LAN that returns NOT the external IP of your router, but instead the INTERNAL ip of the server on the LAN (192.168.0.2, for example). That way, the rest of the world will get your external IP when they lookup your domain name, but clients on the local LAN will think that it's just another local network device, and will connect accordingly.
Most home routers run super-simple DNS services for you automatically, and rarely allow you to manually configure it. So if you can't modify your router's DNS records, you need to run your own DNS server somewhere on the LAN (it could be on the web server itself, for instance.)
You should look into the DNSMasq software; many home routers and small ISP DNS servers run it, and it's quite simple to configure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.