Skip site navigation (1)Skip section navigation (2)
Date:      11 Dec 2002 23:55:09 -0800
From:      Ken McGlothlen <mcglk@artlogix.com>
To:        Bsd Neophyte <bsdneophyte@yahoo.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: hosting more than one website on a cable connection (DHCP)...  and using BIND
Message-ID:  <86k7ifllia.fsf@ralf.artlogix.com>
In-Reply-To: <20021212072707.58724.qmail@web20109.mail.yahoo.com>
References:  <20021212072707.58724.qmail@web20109.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bsd Neophyte <bsdneophyte@yahoo.com> writes:

| I have a cable connection that uses DHCP, giving me a lease for about 2
| minutes.  Usually the address stays the same, but at times it does change.
| 
| I want to host two domain names to start.  I also would like to have the
| possiblity to host more.  I will have only one changing IP.

Well, okay.  The trick (as you already know) is to have whatever is hosting
your DNS entries to automatically update.  You'll want to investigate at

        http://www.dyndns.org/

to see which services are right for you.  This is probably the easiest way to
handle dynamic IP DNS.

| I also want to have subdomains.  I want each system at home to have a
| subdomain based on either one of the two domain's I'll have established.  So
| if I have blah.com as my primary domain, I want to be able to ssh to
| yadda.blah.com from any other location.  If I want to ssh to yawn.blah.com
| from any other location, it should be able to connect to that system,
| eventhough they are both sharing 1 ip address through Natting.

Uh . . . okay.

That's . . . trickier.

Having subdomains for your webservices is easily done.  You can set up virtual
webservers in Apache all day on the same box, and go nuts with it.  The reason
it works is because they're all sitting at the same port on the same machine,
and Apache is sensitive to what domain name was used to access it.  ssh, on the
other hand, isn't.  If yadda and yawn are separate machines, and they're
sitting behind a firewall, and you want to get to them via SSH, you're going to
have to have separate ports on the firewall which will redirect to port 22 on
the target boxes.  Make sense?

| I've been told I can use these free third party domain name servers.  I've
| also been told that you need to keep a record with at least 2 domain name
| servers when hosting a domain name.

I suspect that dyndns.org has backup DNS already.  :)  In general, though,
having a DNS server behind a dynamic IP is . . . pointless.  Having an internal
DNS for your own firewalled network makes perfect sense, but you can't expect
to have the outside world use it.

| Now, I'm completely confused if this can be done and if it can, then how
| to do it.

This can be done.  How . . . well, start with dyndns.org; you'll have to handle
that bit first.  The rest is just ipfw/natd (or ipfilter/ipnat), Apache, and a
few other tidbits.

| The FreeBSD handbook seems pretty straight-forward in setting up BIND. 
| However, I don't know how to distinguish more than one domain name when
| using only one IP address.

Separate zone files.  One might be

        $TTL 1D
        @	IN	SOA dnsi.blah.com. hostmaster.blah.com (
                        2002120501 	; serial
                        8H		; 2ndary chk
                        2H		; retry
                        1W		; discard
                        1W		; RR TTL
                )
                A	192.168.0.2
                MX	10 mx.blah.com.
                MX      20 mx.offsitebackupmx.com.
        mx      A       192.168.0.2
        yadda	A	192.168.0.2
        yawn    A       192.168.0.2
        www	CNAME   yadda
        dnsi    CNAME   yawn

and another would be

        $TTL 1D
        @	IN	SOA dnsi.feh.com. hostmaster.feh.com (
                        2002120501 	; serial
                        8H		; 2ndary chk
                        2H		; retry
                        1W		; discard
                        1W		; RR TTL
                )
                A	192.168.0.2
                MX	10 mx.feh.com.
                MX      20 mx.offsitebackupmx.com.
        mx      A       192.168.0.2
        scratch	A	192.168.0.2
        belch   A       192.168.0.2
        www	CNAME   scratch
        dnsi    CNAME   belch

All the names just point to the same place in this case.

| Also, is it possible for the home DNS and the third party DNS's to work in
| tandem?

Probably not in the way you're expecting.  With dynamic DNS, you're pretty much
going to be dependent on external services for others trying to reach your
site.  When you get a static IP, you can pretty much do whatever you need.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86k7ifllia.fsf>