www.smartbusinesschoices.com

Leading Business and Technology,
News and information


Part of the Identityscape.com network...

getxfactor.com jmoodmusic.com smartbusinesschoices.com mintdepot.com lowfaresalways.com evangelicalview.com shoppingpodder.com soproudlywehail.com webnews.ws currenthumor.com

 

 

etc/hosts question
   Smart Linux Business Choices! - the Best of UseNet Postings! Forum Index -> Linux - Suse Forum  
View previous topic :: View next topic  
Author Message
Michael Soibelman
Guest






PostPosted: Wed Nov 12, 2008 2:11 am    Post subject: etc/hosts question Reply with quote

I have a simple lan with two computers.

1. Gateway box

hostname (jupiter)

eth0 (dhcp) to outside
eth1 (192.168.0.1)to internal box

2. Internal machine

hostname (mercury)

eth0 (192.168.0.2) to Gateway box connected directly via x-over cable to
eth1 (192.168.0.1) on Gateway (jupiter). Mercury connects to internet using
IPForwarding on jupiter.


I can connect to the internal machine from the gateway box using the url
http://192.168.0.2. I can connect to the gateway box from the internal
machine using 192.168.0.1. So all is well there. What I'd like to do is
to connect to the other box using the hostname as well. So to connect to
the internal box from the gateway I want to be able to type http://mercury.
And to connect to the gateway from the internal machine I'd like to be able
to type http://jupiter.

So what do I need to do to enable this ? Do I need to run dns on one or
both machines ? How do I set this up ? I'd prefer to use Yast but I'll
edit whichever files need editing on either machine if that's the way to do
this.

Thanks in advance.
Back to top
Larry Bristol
Guest






PostPosted: Wed Nov 12, 2008 2:39 am    Post subject: Re: etc/hosts question Reply with quote

Michael Soibelman wrote:

Quote:
I have a simple lan with two computers.

1. Gateway box

hostname (jupiter)

eth0 (dhcp) to outside
eth1 (192.168.0.1)to internal box

2. Internal machine

hostname (mercury)

eth0 (192.168.0.2) to Gateway box connected directly via x-over cable to
eth1 (192.168.0.1) on Gateway (jupiter). Mercury connects to internet
using IPForwarding on jupiter.


I can connect to the internal machine from the gateway box using the url
http://192.168.0.2. I can connect to the gateway box from the internal
machine using 192.168.0.1. So all is well there. What I'd like to do is
to connect to the other box using the hostname as well. So to connect to
the internal box from the gateway I want to be able to type
http://mercury. And to connect to the gateway from the internal machine
I'd like to be able to type http://jupiter.

So what do I need to do to enable this ? Do I need to run dns on one or
both machines ? How do I set this up ? I'd prefer to use Yast but I'll
edit whichever files need editing on either machine if that's the way to
do this.

Thanks in advance.

Rather than dealing with a DNS server, you can use a simple method. It can
even be implemented in YaST! Go to "YaST->Network Services->Hostnames".
On each machine, click the "Add" button and enter the IP address and
hostname of the other computer. One saved, you will be able to refer to
each machine by its name.

All you are doing is using YaST to edit the file mentioned in your subject
line (/etc/hosts). It's such a simple format, you can do it with any text
editor. You will, of course, need root permissions to edit the file.
Back to top
Michael Soibelman
Guest






PostPosted: Wed Nov 12, 2008 2:44 am    Post subject: Re: etc/hosts question Reply with quote

Larry Bristol wrote:

--------------------------------snip----------------------------------------
Quote:
Rather than dealing with a DNS server, you can use a simple method. It
can
even be implemented in YaST! Go to "YaST->Network Services->Hostnames".
On each machine, click the "Add" button and enter the IP address and
hostname of the other computer. One saved, you will be able to refer to
each machine by its name.

All you are doing is using YaST to edit the file mentioned in your subject
line (/etc/hosts). It's such a simple format, you can do it with any text
editor. You will, of course, need root permissions to edit the file.

Thanks. It's working just fine now. I thought it was simple and it was.

Smile
Back to top
houghi
Guest






PostPosted: Wed Nov 12, 2008 4:38 am    Post subject: Re: etc/hosts question Reply with quote

Michael Soibelman wrote:
Quote:
Thanks. It's working just fine now. I thought it was simple and it was.

You can have fun with /etc/hosts Look at what is there and if you have
an other person using the computer, you can point a site to anywhere you
desire.

I use it a bit more usefull. I add (ADD, not replace) the content of
http://www.mvps.org/winhelp2002/hosts.txt to my hosts file. I update it
monthly.

Do not forget that when you do changes in YaST that are related to DNS
to remove the extra information first, otherwise it will take a LONG
time to do anything.

Also remember that you have it. Once in a while a site might not work
and you will need to remove an extry. During normal browsing it works
fast and good.

houghi
--
Usenet is like a herd of performing elephants with diarrhea - massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it.
Back to top
Nikos Chantziaras
Guest






PostPosted: Thu Nov 13, 2008 5:06 am    Post subject: Re: etc/hosts question Reply with quote

Michael Soibelman wrote:
Quote:
I have a simple lan with two computers.

1. Gateway box

hostname (jupiter)

eth0 (dhcp) to outside
eth1 (192.168.0.1)to internal box

2. Internal machine

hostname (mercury)

eth0 (192.168.0.2) to Gateway box connected directly via x-over cable to
eth1 (192.168.0.1) on Gateway (jupiter). Mercury connects to internet using
IPForwarding on jupiter.


I can connect to the internal machine from the gateway box using the url
http://192.168.0.2. I can connect to the gateway box from the internal
machine using 192.168.0.1. So all is well there. What I'd like to do is
to connect to the other box using the hostname as well. So to connect to
the internal box from the gateway I want to be able to type http://mercury.
And to connect to the gateway from the internal machine I'd like to be able
to type http://jupiter.

So what do I need to do to enable this ? Do I need to run dns on one or
both machines ? How do I set this up ? I'd prefer to use Yast but I'll
edit whichever files need editing on either machine if that's the way to do
this.

Editing /etc/hosts works, but also check if your router has a DNS
server. Here, I always can connect to other machines on the LAN by
using their hostnames and without touching the hosts file simply by
making sure the rooter's (an old Thomson SpeedTouch, a "Home gateway")
DNS is active.
Back to top
Bob Bob
Guest






PostPosted: Thu Nov 13, 2008 5:54 pm    Post subject: Re: etc/hosts question Reply with quote

The router box has to be running DDNS I think. This listens to the DHCP
request from the internal client and when it farms out the IP also
creates a DNS record for the same host.

In the OP's case though I dont think that will work as only one of the
PC's is direct connected to the router. The interconnection between the
two PC's is not using DHCP either.

Does your SpeedTouch router use DDNS or some other system?

In pretty well all my *nix installs I setup a local caching DNS and also
create a master A/PTR set for the private address range. I would
suspect it would be more a wasted effort for just two machines.
/etc/hosts would seem to be fine for private/internal and setup
/etc/resolv.conf for the router as DNS for public/external addresses.
You can also run nscd if you want to reduce hard resolution lookups. (It
is a name, hosts, passwd and group cache)

Cheers Bob

Nikos Chantziaras wrote:
Quote:
Editing /etc/hosts works, but also check if your router has a DNS
server. Here, I always can connect to other machines on the LAN by
using their hostnames and without touching the hosts file simply by
making sure the rooter's (an old Thomson SpeedTouch, a "Home gateway")
DNS is active.
Back to top
Display posts from previous:   
   Smart Linux Business Choices! - the Best of UseNet Postings! Forum Index -> Linux - Suse Forum  
Page 1 of 1
All times are GMT

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum