#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    C eh N eh D eh.
    Posts
    2
    Rep Power
    0

    Name based web hosting with DNS


    Hi All!

    I am trying to setup apache2 to do name based vhosting. There is **LOTS** of info on how to do this, but everyone says 'add entry to dns'

    well it sounds simple..

    How then, with bind9, do I add an entry to dns? (please don't say 'with vi' because I might throw up - it would be funny tho')

    If someone can toss me some examples, I'll owe them beer. *****LOTS OF IT*****

    My setup:
    Debian 3 Linux 2.4.21
    Bind9
    Apache2
    php4
    MySQL

    server name is trillian.mydomain.ca
    located at /www/trillian/
    new website is www.danimal.ca and ftp.danimal.ca
    located at /www/dainmal/

    from httpd.conf
    <VirtualHost *>
    ServerAdmin Danimal@telus.net
    DocumentRoot /www/danimal/
    ServerName danimal.ca
    </VirtualHost>

    <VirtualHost *>
    ServerAdmin Danimal@telus.net
    DocumentRoot /www/trillian/
    ServerName trillian.mydomain.ca
    </VirtualHost>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    I am trying to setup apache2 to do name based vhosting. There is **LOTS** of info on how to do this, but everyone says 'add entry to dns'

    well it sounds simple..

    How then, with bind9, do I add an entry to dns? (please don't say 'with vi' because I might throw up - it would be funny tho')
    The problem is that there is 100 ways to setup dns depending on your network topography and software used, so describing dns setup in the apache manual would be a little bit off-topic and double its number of pages.

    Adding the entry itself is really simple. What you want is called an "A record". It will point "www2.mydomain.com" to "1.2.3.4". (your new hostname to your IP) There probably is already at least one A record, "www.mydomain.com".

    For bind9, you have to edit your zone file. Either with a texteditor or with a graphical frontend.
    vi is a text editor. If you donīt like it, you have to find a (working) gui. I am using RH7.2 at work, iirc it comes with a kde gui for bind.

    If you decide to use the text editor, it will be as simple as:
    there is an entry "www IN A 1.2.3.4" or similar. Add "www2 IN A 1.2.3.4" (using the same IP address) just below that line.
    Then restart bind with "service named reload" ("service bind reload"?, "ndc reload"? not sure what debian is using)
  4. #3
  5. DNS/BIND Guru
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2003
    Location
    OH, USA
    Posts
    4,266
    Rep Power
    173
    trillian.mydomain.ca
    www.danimal.ca

    In the first domain you said you are hosting, you say you already have setup in your DNS? Well, it would be setup in your DNS under the zone "mydomain.ca". The zone file is named for "mydomain.ca" in the named.conf as well as points to the file which contains information on that zone.

    So to add www.danimal.ca to the DNS, you need to name "danimal.ca" in the named.conf that points to a new file which contains all information on "danimal.ca" including "www.danimal.ca".
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    50
    Rep Power
    12
    Its been awhile since I used Bind but you need to add

    zone "YourDom.com" {
    type master;
    file "/var/named/YourDom.com.hosts";
    };

    to named.conf and then edit var/named/YourDom.com.hosts file and add entries for your hosts E.G. www.yourdom.com

    Sam Land
    http://www.dyndnsservices.com
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    C eh N eh D eh.
    Posts
    2
    Rep Power
    0
    Thanks, got it fixed...

    biggest problem: named didn't have sufficient permissions to read the zone file. change ownership of the file, works perfectly.

    Thanks again

IMN logo majestic logo threadwatch logo seochat tools logo