LAN using both IP numbers and names

LAN using both IP numbers and names

Post by P » Mon, 09 Dec 2002 04:17:55



Hi there,

I have set up a local network of 3 linux machines:
  1st box: IP=192.168.0.1  Name=box1.mydomain.net
  2nd box: IP=192.168.0.2  Name=box2.mydomain.net
  3rd box: IP=192.168.0.3  Name=box3.mydomain.net
Box 2 and 3 have Submask= 255.255.255.0 and Gateway=192.168.0.1

The 1st box is also connected to the internet with a static IP;
it has two network cards, eth0 for internet, eth1 for LAN.

Currently I do not care about IP Masquerading.

As it is now, each machine can ping to each other and connect
to each other using ssh with IP's but not names, i.e,
   from box2: ssh 192.168.0.3 works fine but
              ssh box3.mydomain.net does not work

How can I make them to understand the names?

Thank you in advance.

PSD

 
 
 

LAN using both IP numbers and names

Post by Bill Marcu » Mon, 09 Dec 2002 04:22:47


On 7 Dec 2002 11:17:55 -0800,

Quote:> Hi there,

> I have set up a local network of 3 linux machines:
>   1st box: IP=192.168.0.1  Name=box1.mydomain.net
>   2nd box: IP=192.168.0.2  Name=box2.mydomain.net
>   3rd box: IP=192.168.0.3  Name=box3.mydomain.net
> Box 2 and 3 have Submask= 255.255.255.0 and Gateway=192.168.0.1

> The 1st box is also connected to the internet with a static IP;
> it has two network cards, eth0 for internet, eth1 for LAN.

> Currently I do not care about IP Masquerading.

> As it is now, each machine can ping to each other and connect
> to each other using ssh with IP's but not names, i.e,
>    from box2: ssh 192.168.0.3 works fine but
>               ssh box3.mydomain.net does not work

> How can I make them to understand the names?

/etc/hosts
127.0.0.1 localhost
192.168.0.3 box3.mydomain.net box3

 
 
 

LAN using both IP numbers and names

Post by Paul Lutu » Mon, 09 Dec 2002 04:24:24



> Hi there,

> I have set up a local network of 3 linux machines:
>   1st box: IP=192.168.0.1  Name=box1.mydomain.net 2nd box:
>   IP=192.168.0.2  Name=box2.mydomain.net 3rd box: IP=192.168.0.3
>   Name=box3.mydomain.net
> Box 2 and 3 have Submask= 255.255.255.0 and Gateway=192.168.0.1

> The 1st box is also connected to the internet with a static IP; it has
> two network cards, eth0 for internet, eth1 for LAN.

> Currently I do not care about IP Masquerading.

> As it is now, each machine can ping to each other and connect to each
> other using ssh with IP's but not names, i.e,
>    from box2: ssh 192.168.0.3 works fine but
>               ssh box3.mydomain.net does not work

Define "does not work". Exactly what happens? To make this work on a
private net easily, put all the names and addreses in each machine's
/etc/hosts file, and make sure /etc/resolv.conf is empty when you are not
logged onto an outside network.

--
Paul Lutus
www.arachnoid.com

 
 
 

LAN using both IP numbers and names

Post by Floyd Davidso » Mon, 09 Dec 2002 05:27:19




>> Hi there,

>> I have set up a local network of 3 linux machines:
>>   1st box: IP=192.168.0.1  Name=box1.mydomain.net 2nd box:
>>   IP=192.168.0.2  Name=box2.mydomain.net 3rd box: IP=192.168.0.3
>>   Name=box3.mydomain.net
>> Box 2 and 3 have Submask= 255.255.255.0 and Gateway=192.168.0.1

>> The 1st box is also connected to the internet with a static IP; it has
>> two network cards, eth0 for internet, eth1 for LAN.

>> Currently I do not care about IP Masquerading.

>> As it is now, each machine can ping to each other and connect to each
>> other using ssh with IP's but not names, i.e,
>>    from box2: ssh 192.168.0.3 works fine but
>>               ssh box3.mydomain.net does not work

>Define "does not work". Exactly what happens? To make this work on a
>private net easily, put all the names and addreses in each machine's
>/etc/hosts file, and make sure /etc/resolv.conf is empty when you are not
>logged onto an outside network.

There is no need to change a thing with /etc/resolv.conf, as long
as /etc/hosts.conf has these two lines,

  order hosts, bind
  multi on

The first one tells the resolver to look in /etc/hosts first, so
if a match is found there no external DNS lookup will be
attempted.

The OP should note that Paul's advice about /etc/hosts is
exactly correct.  Another response showed only a listing for
box3, but each of the three hosts should have them all,

   192.168.0.1     box1.mydomain.net box1
   192.168.0.2     box2.mydomain.net box2
   192.168.0.3     box3.mydomain.net box3

--
Floyd L. Davidson         <http://www.ptialaska.net/~floyd>

 
 
 

LAN using both IP numbers and names

Post by David Schwart » Mon, 09 Dec 2002 08:35:25



> Hi there,

> I have set up a local network of 3 linux machines:
>   1st box: IP=192.168.0.1  Name=box1.mydomain.net
>   2nd box: IP=192.168.0.2  Name=box2.mydomain.net
>   3rd box: IP=192.168.0.3  Name=box3.mydomain.net
> Box 2 and 3 have Submask= 255.255.255.0 and Gateway=192.168.0.1

> The 1st box is also connected to the internet with a static IP;
> it has two network cards, eth0 for internet, eth1 for LAN.

> Currently I do not care about IP Masquerading.

> As it is now, each machine can ping to each other and connect
> to each other using ssh with IP's but not names, i.e,
>    from box2: ssh 192.168.0.3 works fine but
>               ssh box3.mydomain.net does not work

> How can I make them to understand the names?

        Is the domain 'mydomain.net' a domain that is actually yours? If so,
your best bet is to make the machine at 192.168.0.1 hold a copy of that
domain (either as primary or slave) and have the other machines use that
machine as their DNS server.

        DS

 
 
 

LAN using both IP numbers and names

Post by P » Wed, 11 Dec 2002 16:53:30



> There is no need to change a thing with /etc/resolv.conf, as long
> as /etc/hosts.conf has these two lines,

>   order hosts, bind
>   multi on

> The first one tells the resolver to look in /etc/hosts first, so
> if a match is found there no external DNS lookup will be
> attempted.

> The OP should note that Paul's advice about /etc/hosts is
> exactly correct.  Another response showed only a listing for
> box3, but each of the three hosts should have them all,

>    192.168.0.1     box1.mydomain.net box1
>    192.168.0.2     box2.mydomain.net box2
>    192.168.0.3     box3.mydomain.net box3

Dear Flyod, Bill, Paul and  David:

Thanks for your help. It works now fine!

PSD

 
 
 

1. Can only access web server using IP number not host name...why?

Hi

I've got Apache running on my Linux box and also
Netscape. I can access the web pages on the server
using the host name. If I login from a PC and run
Netscape I have to use the IP address of the server
to access the pages. Is this to do with DNS and if
so what do I have to do to allow me to use the host
name instead?

Cheers

Mike Varley
--
         `\|||/'
          (o o)      
-------ooO_(_)_Ooo---------|Mike Varley, Network Manager
 /\_/\   |   __      \   / |North Area College 0161 442 7494

 | | | | |\ |__   |    V   |  101 uses for John Major, No.43:    
                           |    A guard for your lettuce.

2. libc.so.5.2.18 problems

3. IP-Forwarding PPP-LAN but not LAN-LAN

4. mptctl only as a module?

5. access public IP number from the LAN

6. General RH 5.9 Network Question...

7. Top 10 subjects comp.unix.admin

8. can i get a user IP by knowing his user-name on a LAN

9. can only identify machines on LAN by IP, not by name ...

10. dns on lan, without registered ip or domain name

11. LAN monitoring app to get a host's NetBios name + IP address?

12. How to find address name from IP number?