-   Linux - Networking (
-   -   Two hosts on DDNS. Can I send two domains through one router? (

alar 02-11-2011 03:26 PM

Two hosts on DDNS. Can I send two domains through one router?
I have two virtual hosts that I want to be able to send through one router. I have two seperate dynamic hostnames on dyndns. Apparently my router allows me to enter two seperate hostnames locally as well:
Host and Domain Name

Locally, vhost 1 is on eth0. vhost 2 is on eth0:0.
How do I tell the router which is which? Currently I see the same site with both URLs :(
Do I have to set one vhost to do some 'funky' stuff (black hole in my head when it comes to static routes or BIND? ). And then set the other vhost to host both sites?
I'm running CentOS and an apache webserver. I want to demo a web site 'externally' from two different sub-domains.
I've looked high and low but most examples don't seem to be simply trying to put two different web-sites up to two Dynamic DNS Hosts.
It must be possible, all the pieces are there. I'm just missing the link!!! (I think...)

acid_kewpie 02-11-2011 03:44 PM

if these are fronted by the same pshycial server, then yeah it's just *very* simple virtual hosts config under apache. the router doesn't care in the slightest, it just passes traffic on port 80 through to the designated back end. Ignore the "Dynamic DNS" side of things, that's irrelevant at the apache level. just a case of two FQDN's which you'll need virtual hosts for.

alar 02-11-2011 04:57 PM

I don't doubt it's simple but how can I ignore the DDNS side?
I have multiple VirtualHosts on apache and I can see them all internally, usually with the same internal IP address, different hostnames of course. But if an external web-site has a link to 'another' external web site it's a different DDNS address... No???
How do I let external users click on two different links? (I'm so not a Network guy!)
A fully qualified domain name? Routers are black holes to me. Inside vs outside, which name refers to which end?

bilbo.baggins -->
frodo.baggins -->

or are you saying I should be able to point to bilbo or frodo just through Because I don't see that...

gilead 02-11-2011 05:48 PM

If dyndns is sending traffic on port 80 to your router it doesn't matter which domain it's for. Just have your router forward traffic for port 80 to your Apache box. Apache will determine which virtual host serves up the pages based on the domain name.

I have 2 domains with a custom account at dyndns and I just have them both point to the IP address of my router. My router doesn't care which domain the traffic is for, it just sends it all to my web server. My Apache is using name based virtual hosts so I'm only using one network connection on the web server (eth0).

I think that's what acid_kewpie was saying...

acid_kewpie 02-12-2011 01:26 AM

It would help for you to understand the OSI model a little, and things would be a lot simpler for you. virtual hosts in apache use HTTP data, this is at layer 7. but home adsl routers only deal with traffic at layer 3 (The IP address) and layer 4 (The TCP port) so in terms of your router it doesn't see the HTTP level data, i.e. which virtual host, so it doesn't matter there what it is, or how it's defined (i.e. the DDNS stuff doesn't matter - setting DDNS is a point in time thing, which is "out of band" with respect to the use of the hostname - you just go set it when it changes and outside of that nothing else happens). Basically - Divide and conquer!

alar 02-12-2011 08:14 AM

Thankyou acid_kewpie, that explanation sunk in! Using the OSI model drilled in what you said in the first post, and gilead confirmed. But now I get it!!!

virtual hosts config under apache
So the links still don't work but I know why it is not a router issue now!!!
My focus moves to httpd.conf...
Thanks both of you :)

alar 02-14-2011 10:07 AM

I have two FQDN names configured in my httpd.conf


DocumentRoot /var/www/html/site1
<Directory /var/www/html/site1>
allow from all
Options +Indexes

DocumentRoot /var/www/html/site2
<Directory "/var/www/html/site2">
allow from all
Options +Indexes
Up until know I have always just used "hosts" on my home server.
Do I have to set up Linux DNS now?

I still see the same page from both addresses. Even locally. Is that because I'm using different document roots?

I've been putting off learning this stuff for too many years now... It's time to fill this void!!!

acid_kewpie 02-14-2011 01:21 PM

You don't need to run your own DNS at all, you just need valid DNS records somewhere in the system, possibly from your domain registrar etc. you *can* do it yourself, but it's probably more hassle than it's worth if you depend on it at all. Personally I used to use a lot for this sort of thing.

alar 02-14-2011 02:36 PM

Is the hassle with DynDNS in IP address synchonization? I already have ddclient configured and running!!
Your current location's IP address is:
correct for both.
Is that how I get

you just need valid DNS records somewhere in the system,
(I loved Networking in school... it's just been a really long time...)
Willing to try though! Many thanks!

acid_kewpie 02-14-2011 03:41 PM

using a dyndns service is NOT running your own DNS in any way. It's letting someone else run it, and you kicking them occasionally. I would suggest doing what you're apparently already doing. You'd just need to run it twice for two different addresses.

alar 02-15-2011 08:18 AM

Success!! The very last bit I changed was enabling
# NameVirtualHost *:80
and setting it to the "new web site!"

The thinking goes is that the original site was working as is. Adding a site required a Virtual Host container, enabled above.

Phew! Now I'm ready to demo!
Thanks guys!

All times are GMT -5. The time now is 04:46 AM.