How to setup Multiple domains on a single IP

phn at icke-reklam.ipsec.nu phn at icke-reklam.ipsec.nu
Thu Jul 25 17:15:54 UTC 2002


vin <kvinay at softhome.net> wrote:
> Friends,
> I have a few questions on how to configure multiple domains on a single IP
> address.My questions may sound naive cuz  I'am new to all these kind of
> stuff.

> I have registered 3 domain names (say abc.com , xyz.com , def.com ) with
> network solutions . I would like to set up my own name servers(prim and
> second) for these 3 domains . I have 2 public ip addresses with me(1.2.3.4
> & 1.2.3.5). I would like to setup primary and secondary nameservers for all
> the 3 domains using these two ips.  I pointed
> abc.com to-----------> nameservers  ns1.abc.com   (ip address 1.2.3.4)
> &     ns2.abc.com(ip add 1.2.3.5 )
>  xyz.com to -----------> nameservers ns1.xyz.com  (ip address 1.2.3.4)
> &    ns2.xyz.com(ip add 1.2.3.5 )
> def.com to-------------->nameservers ns1.def.com  (ip address 1.2.3.4)
> &    ns2.def.com(ip add 1.2.3.5 )

> Iam using BIND 8 with solaris 8 as my OS. I have two systems with their
> hostnames as ns1 & ns2 respectively. I want to configure all the primary
> nameservers  on ns1 and their secondary nameservers on ns2.

> Question 1) Can I have mutlitple nameservers registered on one ip address
> like what I've done above. (If yes , then what domain name will  a reverse
> lookup for the ip 1.2.3.4 return ?).

You don't have to. It's perfectly reasoonable to have site abc.com 
serverd by ns1.def.vom and ns2.def.com

You should however locate the second nameserver on a different site.

>    2) Assuming yes as the answer for the first question, how do i configure
> named.conf on host ns1. How can I setup reverse lookup records for all the
> three domains . I can use 3.2.1.in-addr.arpa for any one domain say abc.com.
> How is the entry for the reverse mappings going to be for the other 2
> domains. Can i add another map as 3.2.1.in-addr.arpa for xyz.com and def.com
> ....

( answer on (1) is no :-)
It's enough with one PTR record for a certain IP. 


> My named.conf is as follows:----->

> options {
>         directory "/var/named";
>         pid-file "named.pid";
>         version "Dude surely u must be joking";
> };

> // The list of Root Servers
> zone "." {
>         type hint;
>         file "root.hints";
>          };

> // Forward lookups of the localhost: */
> zone "localdomain" {
>         type master;
>         file "named.localdomain";
>         };

> // Provide a reverse mapping for the loopback address 127.0.0.1
> zone "1.0.0.127.in-addr.arpa" {
>         type master;
>         file "named.local";
>         };
> // Master Name Server for abc.com
> zone "abc.com" {
>         type master;
>         file "db.abc.com";
> };

> // Master Name Server for def.com
> zone "def.com" {
>         type master;
>         file "db.def.com";
> };

> // Master Name Server for xyz.com
> zone "xyz.com" {
>         type master;
>         file "db.xyz.com";
> };
> // Master Name Server for Reverse Lookup for abc.com
> zone "3.2.1.in-addr.arpa" {
>         type master;
>         file "db.kv.1.2.3";
> };


> 3) How is my resolv.conf file going to be? I have setup mine as follows. Any
> corrections to be made ??

> domain abc.com
> domain xyz.com
> domain def.com
> search abc.com xyz.com def.com
> nameserver 1.2.3.4
> nameserver 1.2.3.5

your eresolv.conf will contain one line with "domain <something>"
and two "nameserver  <ip>"

See the manpage for resolv.conf


> 4)Is there any other simple way to setup multiple domains on a single
> ipaddress ? Can I point my domains xyz.com & def.com to ns1.abc.com and just
> put a address record for these  2 domainnames
> If so how is my named.conf file going to be on ns1.abc.com ?

Yes, add an 'A' record at zone top.


> Any help would be highly appreciated. Thanks in advance.

> Vinay




-- 
Peter Håkanson         
        IPSec  Sverige      ( At Gothenburg Riverside )
           Sorry about my e-mail address, but i'm trying to keep spam out,
	   remove "icke-reklam" if you feel for mailing me. Thanx.


More information about the bind-users mailing list