LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Domain Name behind a NAT firewall with Dynamic DNS (https://www.linuxquestions.org/questions/linux-server-73/domain-name-behind-a-nat-firewall-with-dynamic-dns-4175584271/)

crazyeddie740 07-10-2016 02:22 PM

Domain Name behind a NAT firewall with Dynamic DNS
 
It looks like I struck out in the Networking forum, so I'll try my luck here.

I'm in the process of setting up a web server and site on my home network. I'll eventually migrate the site off to a hosted server, but for now, I'm setting up the site on my home network until we can get it set up the way we want.

I'm in the process of getting a Dynamic DNS set up. My plan is to have the Dynamic DNS point to the router (there does appear to be a Dynamic DNS client built into the router), and then port forward from there to the server.

The hostname of the server is currently set to something other than the domainname-to-be. I've just set it to a static IP for the local network (192.168.0.2).

Before I set the server to a static IP, I installed WordPress and phpBB. Right now, the login link on WordPress is pointing to 192.168.0.104 - the dynamic IP the server was assigned before I reset it to the static IP.

My guess is that I need to set up the domain name on the server, and then reinstall WordPress and phpBB. Hopefully, that'll get things like WordPress's login link to point to mydomain.com/login and not 192.168.0.2/login or 192.168.0.104/login. (The later option is not exactly optimal for people wanting to use the site from outside of my home network. The former option still won't work until the Dynamic DNS fairies have sprinkled their fairy dust, but should work once those fairies have done their magic...)

I'm not sure how to configure the domain name on the server. The information my google-fu brought up is a bit confusing, and it looks like the exact magic spells you have to recite vary from distro to distro. I'm currently running Debian Stretch.

af7567 07-10-2016 05:16 PM

The IP address your webserver is listening on shouldn't have anything to do with wordpress or phpbb. If you can still access the website at 192.168.0.104 then your system network settings aren't using the static IP address you set.

Can you also access the website via 192.168.0.2?
Did you set the static IP on your router or in your debian network settings?

After you have port forwarding set up correctly and dyndns, you will probably find that the dyndns URL just works. The stuff before the "/login" in the URL will just stay as whatever you typed into your web browser.

crazyeddie740 07-12-2016 03:51 PM

I do have port forwarding set up on the router. Correctly or not? Who can say. Dynamic DNS has not been set up yet. (Still trying to get my domain name registrar to switch over the name servers.)

I set the static IP (192.168.0.2) on the server, in the range of address reserved for that purpose on the router. I forwarded the ports to that static ip address.

I can access the website via the local network at the .2 address. The login link on .2's wordpress page is still pointing to 192.168.0.104/wp-login.php.

Strangely enough, I did get a "Welcome to nginx on Debian!" page when brought up .104, but I checked, and that IP has been reassigned... to the laptop I'm writing this post on. I'll have to check and see what that's all about...

When I bring up my home's public ip (over the local network), I get .2's webpage. The login link is still pointing to 192.168.0.104/wp-login.php.

I've turned off the wifi on my phone and attempted to bring up my home's public IP over the data connection... and I'm getting absolutely nothing. So either my ISP is blocking incoming http or I didn't set up the port forwarding correctly? BoingBoing came up just fine, so my data plan didn't just suddenly stop working.

At any rate, just for my information, how do domain names usually get set on Debian? Because based on how wordpress is acting, I'm guessing that when I installed and configured it, it went to look at where the host's domain name is normally stored, and wrote down whatever was there. Which in this case was that 192.168.0.104 temporary IP address.

Also, you say that Dynamic DNS might automagically take care of this problem. In that case, would it matter if the client is on the router or on the server? I can't think why it would, but I'll ask anyway, just to be on the safe side.

crazyeddie740 07-12-2016 04:00 PM

Okay, tried tethering my laptop to my phone, and bringing up my home network's public IP over that connection. I got the page title up in the tab, and a "Waiting for 192.168.0.104" message.

I have double checked on my router, and the ports are being forwarded to .2, not .104.

Emerson 07-12-2016 04:02 PM

Portchecker.

michaelk 07-12-2016 04:03 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 02:16 AM.