Multiple Domains under one ip in ubuntu 9.10 server

First we need to install dns packages.

sudo apt-get install bind9

sudo apt-get install dnsutils

Then we have to edit the file  /etc/bind/named.conf.local

sudo gedit /etc/bind/named.conf.local

then type the following content

zone “example1.com” {

type master;

file “/etc/bind/db.example1.com”;

};

zone “example2.com” {

type master;

file “/etc/bind/db.example2.com”;

};

zone “example3.com” {

type master;

file “/etc/bind/db.example3.com”;

};

zone “1.168.192.in-addr.arpa” {

type master;

file “/etc/bind/db.192”;

};

then save the file and exit.then create db.example1.com,db.example2.com,db.example3.com,db.192 files inside /etc/bind directory by execitng the command.

sudo cd /etc/bind

sudo cp db.local db.example1.com

sudo cp db.local db.example2.com

sudo cp db.local db.example3.com

sudo cp db.127 db.192

sudo gedit /etc/bind/db.example1.com

then edit the file as given below.

;

; BIND data file for local loopback interface

;

$TTL    604800

@       IN      SOA     http://www.example1.com. root.www.example1.com. (

2         ; Serial

604800         ; Refresh

86400         ; Retry

2419200         ; Expire

604800 )       ; Negative Cache TTL

;

@         IN      NS       http://www.example1.com.

@         IN       A         192.168.1.16

www    IN      A         192.168.1.16

then save the file and exit.

sudo gedit /etc/bind/db.example2.com

edit this file also with the below given content.

;

; BIND data file for local loopback interface

;

$TTL    604800

@       IN      SOA     http://www.example2.com. root.www.example2.com. (

2         ; Serial

604800         ; Refresh

86400         ; Retry

2419200         ; Expire

604800 )       ; Negative Cache TTL

;

@          IN      NS     http://www.example2.com.

@          IN      A        192.168.1.16

www    IN      A        192.168.1.16

then save and exit the file.

sudo gedit /etc/bind/db.example3.com

then edit the below given content

;

; BIND data file for local loopback interface

;

$TTL    604800

@       IN      SOA     http://www.example3.com. root.example3.com. (

2         ; Serial

604800         ; Refresh

86400         ; Retry

2419200         ; Expire

604800 )       ; Negative Cache TTL

;

@           IN      NS     http://www.example3.com.

@           IN      A       192.168.1.16

www     IN      A       192.168.1.16

then save and exit the file.

sudo gedit /etc/bind/db.192

and edit this file with the given content

;

; BIND reverse data file for local loopback interface

;

$TTL    604800

@       IN      SOA     localhost. root.localhost. (

1         ; Serial

604800         ; Refresh

86400         ; Retry

2419200         ; Expire

604800 )       ; Negative Cache TTL

;

@       IN      NS      localhost.

16      IN      PTR     http://www.example1.com.

16      IN      PTR     http://www.example2.com.

16      IN      PTR     http://www.example3.com.

then save and exit the file.

then restart the bind9 service

/etc/init.d/bind9 restart

then we can check whether dns properly configured or not by executing the command.

host http://www.example1.com

you should get a result like this.

http://www.example1.com has address 192.168.1.16

host http://www.example2.com

again you should get a result like this

http://www.example2.com has address 192.168.1.16

host http://www.example3.com

the result should be like this

http://www.example3.com has address 192.168.1.16

then,

host 192.168.1.16

the result should be something like this

16.1.168.192.in-addr.arpa domain name pointer http://www.example1.com 1.168.192.in-addr.arpa.

16.1.168.192.in-addr.arpa domain name pointer www.example2.com 1.168.192.in-addr.arpa

16.1.168.192.in-addr.arpa domain name pointer www.example3.com 1.168.192.in-addr.arpa

That’s it we have now configured multiple domains for single ip

Now, to ping with our newly configured Domains, just edit resolv.conf file.

Sudo gedit /etc/resolv.conf

nameserver 192.168.1.16

then save and exit the file.

Now we can ping to our Domains.

Advertisements

7 Responses to “Multiple Domains under one ip in ubuntu 9.10 server”

  1. honey Says:

    hi kindly visit this too https://wiki.ubuntu.com/karthick87

  2. www.cheapwebhostingspot.com Says:

    Impressive issues in this article. We’re quite satisfied to see your write-up. Thank you and i am looking ahead to get hold of an individual. Are you going to remember to decrease me a mailbox?

  3. Dieter Says:

    Hello,

    thanks for this tutorial.

    The fellowing section seems to contain little errors:

    @ IN NS localhost.

    16 IN PTR http://www.example1.com.

    16 IN PTR http://www.example2.com.

    16 IN PTR http://www.example3.com.

    it should be

    @ IN NS localhost.

    16 IN PTR http://www.example1.com.

    16 IN PTR http://www.example2.com.

    16 IN PTR http://www.example3.com.

    😉

  4. Dieter Says:

    oupps it seems that http:// is added by the wordpress software …

    the http:// after the PTR instruction should be leaved.

  5. nlp business Says:

    Amazing issues here. I’m very glad to peer your post.
    Thank you a lot and I’m looking ahead too contact you. Will you
    kindly drop me a mail?

  6. charlotte dental clinic charlotte nc Says:

    Hi everyone, it’s my first pay a visit at this website, and post
    is in fact fruitful for me, keep up posting these posts.

  7. high blood pressure Says:

    This is my first time pay a quick visit at here and i am actually pleassant to read
    all at alone place.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: