LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-09-2016, 03:55 AM   #1
crazyeddie740
Member
 
Registered: May 2004
Location: Sedalia, MO
Distribution: Debian, Mandrake
Posts: 71

Rep: Reputation: 15
Domain Name behind a NAT firewall with Dynamic DNS


I'm fairly sure the answer to my question is out there on the web somewhere, but my google-fu has failed me, and what info I could find was somewhat abstruse. So I'll go ahead and ask it 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.
 
Old 07-10-2016, 04:58 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,895

Rep: Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616
In a simple sense, a domain name is just a way to convert a name to an ip address.

Test your configuration in your wan by using the ip address in browser. The lan should be same segment and within the subnet. If 192.168.0.104 will work locally then it should be the address you establish in the ddns in router. Hopefully your ISP will allow you to use port 80.

I think it kind of unlikely that you will be able to access it from 104 so you either have to make a new ip on the nic on host or change either host or web server to be same.
 
Old 07-10-2016, 11:30 PM   #3
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 722

Rep: Reputation: 218Reputation: 218Reputation: 218
You don't need a dynamic DNS service if you just want to access your own webserver on your own internal network. Dynamic DNS is needed if you want the rest of the world to access it and you set on a host with a changing IP address. Then, you can point your dynamic DNS name to whatever your current address is so that you don't have to have your guests guess at what IP address you might currently be at. They used to be free, but many of the better ones charge money nowdays. As for configuring stuff, you shouldn't have to reinstall it - just change the values in the config files. Once you get a dynamic DNS name, stick that in config files.
 
Old 07-12-2016, 05:13 PM   #4
crazyeddie740
Member
 
Registered: May 2004
Location: Sedalia, MO
Distribution: Debian, Mandrake
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jayjwa View Post
You don't need a dynamic DNS service if you just want to access your own webserver on your own internal network. Dynamic DNS is needed if you want the rest of the world to access it and you set on a host with a changing IP address. Then, you can point your dynamic DNS name to whatever your current address is so that you don't have to have your guests guess at what IP address you might currently be at. They used to be free, but many of the better ones charge money nowdays. As for configuring stuff, you shouldn't have to reinstall it - just change the values in the config files. Once you get a dynamic DNS name, stick that in config files.
I'm not the only one working on this project, and I'd like the other members of my team to be able to access the site from their home. I've found a DDNS I'm happy with so far. Wish I could say the same with the ISP I made the mistake of registering the domain name through, since I could have gotten that done much cheaper elsewhere and I'm having troubles getting the information I need to change over the name servers for the DDNS.

I guess what I'm trying to figure out is what config files I need to change. I'm guessing what happened is that WordPress looked at whatever place the host server stores its domain name. Since I hadn't set a domain name, what was written there was the temp IP address (192.168.0.104). So it wrote that down instead. When I do get a domain name/DDNS set up, what config files will I need to change to get this thing to work?

Last edited by crazyeddie740; 07-12-2016 at 05:16 PM.
 
Old 07-12-2016, 05:15 PM   #5
crazyeddie740
Member
 
Registered: May 2004
Location: Sedalia, MO
Distribution: Debian, Mandrake
Posts: 71

Original Poster
Rep: Reputation: 15
I made the mistake of cross-posting this: http://www.linuxquestions.org/questi...ns-4175584271/ The other thread has been locked, but there is more information on what testing I've done over there.
 
Old 07-12-2016, 05:25 PM   #6
crazyeddie740
Member
 
Registered: May 2004
Location: Sedalia, MO
Distribution: Debian, Mandrake
Posts: 71

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jefro View Post
In a simple sense, a domain name is just a way to convert a name to an ip address.

Test your configuration in your wan by using the ip address in browser. The lan should be same segment and within the subnet. If 192.168.0.104 will work locally then it should be the address you establish in the ddns in router. Hopefully your ISP will allow you to use port 80.

I think it kind of unlikely that you will be able to access it from 104 so you either have to make a new ip on the nic on host or change either host or web server to be same.
It does look like my home's ISP is allowing me to use port 80, since the title of the page comes up in the browser tab when I try to access my home's public IP via an external network. But nothing else comes up except "waiting for 192.168.0.104."

When I access 192.168.0.2 via the local network, the initial WordPress page does successfully come up (not just the page's title in the browser tab), but the login link is pointing to 192.168.0.104. Which is not currently assigned to my server.

Quote:
I think it kind of unlikely that you will be able to access it from 104 so you either have to make a new ip on the nic on host or change either host or web server to be same.
Wait. "Change either host or webserver to be same"? Er, how does the webserver know its IP address? I've been thinking that when I installed WordPress, it looked at some config file to figure out what its domain name is. Since I hadn't set one up yet, it just wrote down whatever was there, which happened to be the server's current IP address (192.168.0.104). But maybe Apache is the villain instead?

How do domain names usually get set on servers? I haven't been able to track that information down yet.
 
Old 07-13-2016, 12:58 AM   #7
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
Quote:
How do domain names usually get set on servers? I haven't been able to track that information down yet.
To get a domain name available on the public internet, you first must register the domain name with an accredited registrar. Then you, as the domain owner, will assign the "authoritative" dns server(s) to your domain. For mysel, I let my registrar (godaddy) also provide the dns.

Next, you create a host entry in your dns that "points" to your public ip address. If you don't have a static public ip address, you'll use dynamic dns service. The end result is when someone plunks "www.yourdomainname.com" in a browser their computer will be able to identify the public ip address of your server.

If you have a NAT router on your public IP, you need to set up your server with a static internal (LAN) ip address. Then you visit your NAT router configuration settings and port forward http and https through the router so those ports squirt out on your server's internal static ip.

Usually your web server doesn't need to know your server public ip, and the web serve also usually figures out the domain name requested from the user's browser request. Otherwise you'd have a hard time sharing multiple domain names on a single public ip address.
 
Old 07-14-2016, 06:59 PM   #8
funkytwig
Member
 
Registered: Jun 2016
Posts: 46

Rep: Reputation: Disabled
This may help. Get your DYDNS setup and tell Apache (or whatever web-server you are using) that that is the domain name for the websie. Then just use the domain name. Forward HTTP or HTTPS on your router to the box with the wesite on it. You also have to tell wordpress (and any other webapps you are using) what the domain is. Thats all there is to it....I thbik. I have done it for a few things and its fairly straight forward. A domain is a domain. Douse matter if it is dynamic or not. So look into how to set up weordpress etc to use a domain.

Ben
 
Old 07-14-2016, 09:32 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,895

Rep: Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616Reputation: 3616
I get the feeling that most of this is correct. When you access it via 102 it says waiting for 104 so it could be as simple as fixing the web page. Apache like IIS can serve a number of products at the same time. What I get the feeling is that you have a web page someplace and it may be automated to point to a new secondary something. In any case, in a soho setup, you'd normally have all things on same IP address. You could add in maybe more IP addresses on the nic for other reasons and it could be as simple as making a new virtual ip address on the nic. Wouldn't be normal way of fixing it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic DNS and Best Domain registerer mlinuxk Linux - Networking 3 09-15-2012 02:55 AM
firewall using dynamic dns for inbound connections ptah_be Linux - Security 8 02-06-2006 04:44 AM
Dynamic DNS and stale firewall lookups socom Linux - Networking 2 02-28-2004 09:21 PM
DNS, Domain, dynamic IP... Are these are just 25 cent words? MasterC General 8 06-01-2003 11:41 AM
DNS / Mail / NAT capable modem-router / Linux firewall stealthy1 Linux - Networking 9 04-01-2003 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration