etc/hosts question - Suse

This is a discussion on etc/hosts question - Suse ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: etc/hosts question

  1. etc/hosts question

    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.

  2. Re: etc/hosts question

    Michael Soibelman wrote:

    > 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.


  3. Re: etc/hosts question

    Larry Bristol wrote:

    --------------------------------snip----------------------------------------
    > 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.

    :-)

  4. Re: etc/hosts question

    Michael Soibelman wrote:
    > 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.

+ Reply to Thread