Networking Forums

Networking Forums > Computer Networking > Linux Networking > How do I share an IP address for two domains?

Reply
Thread Tools Display Modes

How do I share an IP address for two domains?

 
 
Polaris431
Guest
Posts: n/a

 
      05-09-2007, 01:16 PM
I have two domains and I want both of them to point to the same web
server using the same IP address. One domain is called teachkids.us
and the other is b-matrix.org.

>From my understanding, it should be possible to use the same IP

address and then on the web server setup two virtual websites: one
site for teachkids.us and the other for b-matrix.org.

This should be possible because in the recent past I had multiple
domains using a shared IP address but each domain had its own website
on the same server. I suppose that the web server doesn't look at the
IP address but probably gets information about domain from the sender
and knows what site to access.

Unfortunately I cannot do this on someone elses system and am not sure
why.

If I ping teachkids.us, the IP address is 71.249.137.181
If I ping b-matrix.org, the IP address is 63.251.92.195 Why??

Both domains are registered at the same location and both use the same
DNS entries:

dns1.name-services.com
dns2.name-services.com
dns3.name-services.com
dns4.name-services.com
dns5.name-services.com

So where am I getting a different IP address for b-matrix.org from?
Where is this set?

If I use NSLookup and set the server to dns1.name-services.com and
then type in b-matrix.org, it shows the IP address as 69.25.142.3

I'm entirely confused. For b-matrix.org, I get 63.251.92.195 pinging,
then I get 69.25.142.3 using NSLookup. Why does NSLookup give me
something entirely different again? What do I have to do to get the IP
address for b-matrix.org to be 71.249.137.181?

Thanks for your help!

 
Reply With Quote
 
 
 
 
Davide Bianchi
Guest
Posts: n/a

 
      05-09-2007, 01:24 PM
On 2007-05-09, Polaris431 <(E-Mail Removed)> wrote:
>>From my understanding, it should be possible to use the same IP

> address and then on the web server setup two virtual websites: one
> site for teachkids.us and the other for b-matrix.org.


Just point both domain to the same IP in the DNS and then configure
your web server for name-based virtual hosts.

> If I ping teachkids.us, the IP address is 71.249.137.181
> If I ping b-matrix.org, the IP address is 63.251.92.195 Why??


'cause you didn't configure it correctly.

> So where am I getting a different IP address for b-matrix.org from?


From the DNS

> Where is this set?


In the DNS.

> If I use NSLookup and set the server to dns1.name-services.com and
> then type in b-matrix.org, it shows the IP address as 69.25.142.3


Then one of the DNS is wrong.

> I'm entirely confused. For b-matrix.org, I get 63.251.92.195 pinging,
> then I get 69.25.142.3 using NSLookup. Why does NSLookup give me
> something entirely different again?


'cause NSlookup uses a different set of libraries and works in complete
different way from ping. Ping is *NOT* a way to test DNS.

Davide

--
Normally, machines behave, 'cause they know what's good for them. This
is the main way to tell servers apart from lusers. The lusers don't know
what's good for them. -- Graham Reed on alt.sysadmin.recovery
 
Reply With Quote
 
Polaris431
Guest
Posts: n/a

 
      05-09-2007, 01:34 PM
> 'cause NSlookup uses a different set of libraries and works in complete
> different way from ping. Ping is *NOT* a way to test DNS.
>


Are you saying that Ping does not indicate the true IP address and
NSLookup does?

 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a

 
      05-09-2007, 01:49 PM
On 2007-05-09, Polaris431 <(E-Mail Removed)> wrote:
>
> Are you saying that Ping does not indicate the true IP address and
> NSLookup does?


I am saying that Ping is not to be used for testing dns because is not
designed to do so. Ping doesn't use the same dns-libraries that nslookup
does, in fact, nslookup has the libraries built-in and is considered
obsolete for that reason. nslookup can return a complete different
result than any other network-related tool or software because of the
different implementation. A quick google search will tell you so.

Davide

--
All programs evolve until they can send email. -- Richard Letts
Except Microsoft Exchange. -- Art
 
Reply With Quote
 
Tim Southerwood
Guest
Posts: n/a

 
      05-09-2007, 02:57 PM
Davide Bianchi wrote:

> On 2007-05-09, Polaris431 <(E-Mail Removed)> wrote:
>>
>> Are you saying that Ping does not indicate the true IP address and
>> NSLookup does?

>
> I am saying that Ping is not to be used for testing dns because is not
> designed to do so. Ping doesn't use the same dns-libraries that nslookup
> does, in fact, nslookup has the libraries built-in and is considered
> obsolete for that reason. nslookup can return a complete different
> result than any other network-related tool or software because of the
> different implementation. A quick google search will tell you so.
>
> Davide
>


I agree with the final conclusion, but there is a slight error in this:

GNU ping does not have name resolution libraries built in, but uses glibc's
gethostbyname() which, on GNU/linux at least uses libnss and can derive
it's source data from DNS, LDAP, NIS, files (/etc/hosts) or any number of
other places that someone cares to configure or write a plugin for in some
particular priority order.

nslookup of course interrogates the DNS servers, as does it's more modern
variant: dig

So, to support the point that Davide made, Polaris might want to try adding
this to his /etc/hosts:

10.0.0.1 www.ibm.com

and make sure that /etc/nsswitch.conf contains:

hosts: files dns

Try:

ping www.ibm.com
nslookup www.ibm.com

before and after.

Cheers

Tim
 
Reply With Quote
 
repo
Guest
Posts: n/a

 
      05-09-2007, 06:13 PM
On Wed, 09 May 2007 06:16:29 -0700, Polaris431 wrote:

> I have two domains and I want both of them to point to the same web
> server using the same IP address. One domain is called teachkids.us
> and the other is b-matrix.org.
>
>>From my understanding, it should be possible to use the same IP

> address and then on the web server setup two virtual websites: one
> site for teachkids.us and the other for b-matrix.org.
>
> This should be possible because in the recent past I had multiple
> domains using a shared IP address but each domain had its own website
> on the same server. I suppose that the web server doesn't look at the
> IP address but probably gets information about domain from the sender
> and knows what site to access.
>
> Unfortunately I cannot do this on someone elses system and am not sure
> why.
>
> If I ping teachkids.us, the IP address is 71.249.137.181
> If I ping b-matrix.org, the IP address is 63.251.92.195 Why??
>
> Both domains are registered at the same location and both use the same
> DNS entries:
>
> dns1.name-services.com
> dns2.name-services.com
> dns3.name-services.com
> dns4.name-services.com
> dns5.name-services.com
>
> So where am I getting a different IP address for b-matrix.org from?
> Where is this set?
>
> If I use NSLookup and set the server to dns1.name-services.com and
> then type in b-matrix.org, it shows the IP address as 69.25.142.3
>
> I'm entirely confused. For b-matrix.org, I get 63.251.92.195 pinging,
> then I get 69.25.142.3 using NSLookup. Why does NSLookup give me
> something entirely different again? What do I have to do to get the IP
> address for b-matrix.org to be 71.249.137.181?
>
> Thanks for your help!


You need to contact name-services.com, and ask them to set the right DNS
entries. (A records)

repo@cannabis:~$ nslookup b-matrix.org
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: b-matrix.org
Address: 63.251.92.195
repo@cannabis:~$

repo@cannabis:~$ nslookup teachkids.us
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: teachkids.us
Address: 71.249.137.181
repo@cannabis:~$



--
Chaos, panic & disorder - my work here is done
http://beginnerslinux.org
 
Reply With Quote
 
Chris Davies
Guest
Posts: n/a

 
      05-09-2007, 10:44 PM
Polaris431 <(E-Mail Removed)> wrote:
>>From my understanding, it should be possible to use the same IP

> address and then on the web server setup two virtual websites: one
> site for teachkids.us and the other for b-matrix.org.


Yep. This is called "virtual hosting" and is a standard feature of web
servers such as apache.


> If I ping teachkids.us, the IP address is 71.249.137.181
> If I ping b-matrix.org, the IP address is 63.251.92.195 Why??


Your DNS provider is providing duff information:

$ dig +short b-matrix.org @dns1.name-services.com
69.25.142.3
$ dig +short b-matrix.org @dns2.name-services.com
216.52.184.240
$ dig +short b-matrix.org @dns3.name-services.com
63.251.92.195
$ dig +short b-matrix.org @dns4.name-services.com
64.74.96.243
$ dig +short b-matrix.org @dns5.name-services.com
64.74.96.243

All of those should have been the same value - unless you've deliberately
set up multiple A records for your domain.


While we're here, the SOA shows a strangely lov value (typically but
not necessarily it's usually YYYYMMDDNN, where NN is a sequence value
for changes on that day), but worryingly it's the same for all five
DNS servers:

$ for N in `seq 5`; do dig +short soa b-matrix.org @dns$N.name-services.com; done
dns1.name-services.com. info.name-services.com. 2002050701 10001 1801 604801 181
dns1.name-services.com. info.name-services.com. 2002050701 10001 1801 604801 181
dns1.name-services.com. info.name-services.com. 2002050701 10001 1801 604801 181
dns1.name-services.com. info.name-services.com. 2002050701 10001 1801 604801 181
dns1.name-services.com. info.name-services.com. 2002050701 10001 1801 604801 181

You did increment the SOA serial number when you changed the zone
information, didn't you...?

Chris
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Home Directory Mapping to Share\UserName sometimes maps to Share Bill Windows Networking 3 10-16-2007 03:26 PM
problem accessing share by name vs. ip address... Barry Windows Networking 3 01-04-2006 10:07 PM
Server 2003 with dual NICs to share one static IP address? Brad Windows Networking 4 07-10-2004 10:15 AM
Simple Wireless Network to share ADSL Connection, but we cannot see or share files any more, help Hubert Dethurens Wireless Internet 3 12-22-2003 01:52 PM
Simple Wireless Network to share ADSL Connection, but we cannot see or share files any more, help Frank SERVAIS Wireless Internet 0 12-21-2003 04:22 PM



1 2 3 4 5 6 7 8 9 10 11