LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-11-2011, 03:26 PM   #1
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Rep: Reputation: 37
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:
DynDNS
Host and Domain Name
Code:
host1,host2
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...)

Last edited by alar; 02-11-2011 at 05:05 PM. Reason: added want to demo "externally"
 
Old 02-11-2011, 03:44 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 02-11-2011, 04:57 PM   #3
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Original Poster
Rep: Reputation: 37
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 --> flintstone.dyndns.com
frodo.baggins --> fred.dyndns.com

or are you saying I should be able to point to bilbo or frodo just through flintstone.dyndns.com? Because I don't see that...
 
Old 02-11-2011, 05:48 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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...
 
1 members found this post helpful.
Old 02-12-2011, 01:26 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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!
 
1 members found this post helpful.
Old 02-12-2011, 08:14 AM   #6
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Original Poster
Rep: Reputation: 37
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!!!
Quote:
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
--
Allison
 
Old 02-14-2011, 10:07 AM   #7
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Original Poster
Rep: Reputation: 37
I have two FQDN names configured in my httpd.conf

Quote:
<VirtualHost 192.168.0.4>
ServerName site1.dyndns.org
DocumentRoot /var/www/html/site1
<Directory /var/www/html/site1>
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost 192.168.0.4>
DocumentRoot /var/www/html/site2
ServerName site2.dyndns.org
<Directory "/var/www/html/site2">
allow from all
Options +Indexes
</Directory>
</VirtualHost>
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!!!
 
Old 02-14-2011, 01:21 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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 zoneedit.com a lot for this sort of thing.
 
Old 02-14-2011, 02:36 PM   #9
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Original Poster
Rep: Reputation: 37
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
Quote:
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 zoneedit.com though! Many thanks!
 
Old 02-14-2011, 03:41 PM   #10
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 02-15-2011, 08:18 AM   #11
alar
Member
 
Registered: Sep 2003
Location: Canada
Distribution: Fedora 30
Posts: 341

Original Poster
Rep: Reputation: 37
Smile

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

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!
 
  


Reply



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
[SOLVED] Prep 2wire router/gateway for dhcpd + ddns +name question? NightSky Linux - Networking 4 01-23-2009 11:33 AM
Allowing only certain hosts / domains while blocking the rest using IPTables? lolmannz Linux - Networking 2 10-19-2008 12:16 PM
setup domains in /etc/hosts tommy916 Linux - Networking 1 07-28-2006 05:19 PM
Sub Domains & Virtual Hosts oO_SwooP_Oo Linux - General 11 09-21-2005 02:07 PM
Hosts / domains / IPs / Vhosts Belize Linux - Networking 1 08-22-2003 01:20 AM

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

All times are GMT -5. The time now is 01:18 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