Networking Forums

Networking Forums > Computer Networking > Linux Networking > hosts

Reply
 
 
JW
Guest
Posts: n/a

 
      12-20-2003, 02:02 PM
Have 2 Windows systems networked via NIC's. IP addresses are set manually.
Now added Linux to one system as dual boot.
During Linux install, entered same names and IP address as used with
Windows. Thus hostname is, for example, athlonpc.manderley.com.
However when I look at /etc/hosts file, I simply see one line, namely
127.0.0.1. The hostname is athlonpc.manderley.com, and under alias I have 3
entries, ie athlonpc localhost.localdomain localhost.
This is quite different to that of a friend. He has 3 lines, the first being
127.0.0.1 localhost. The second refers to his manually set IP address and
against that is his full hostname and alias. The third is the IP address of
the of the other pc and its full hostname and alias. (Note he uses Suse 8,
whereas I have Redhat9.0.
Thus question is just what should I see in the hosts file. Is this install
configured first line OK? Should I now add the IP address of my other pc
along with its hostname. I find the documentation found to date is rather
vague and often confuses rather than help! As for functionality, each pc can
at least communicate using ping command.


 
Reply With Quote
 
 
 
 
mgrd
Guest
Posts: n/a

 
      12-20-2003, 02:22 PM
JW wrote:
[..]
> IP addresses are set manually.

[..]
> Thus hostname is, for example, athlonpc.manderley.com.

[..]
> However when I look at /etc/hosts file, I simply see one line, namely
> 127.0.0.1.

[..]
> Thus question is just what should I see in the hosts file. Is this install
> configured first line OK? Should I now add the IP address of my other pc
> along with its hostname.

[..]

set the (full qualified) hostname in /etc/HOSTNAME

in /etc/hosts define:
127.0.0.1 localhost
<ip_of_athlonpc.manderley.com> athlonpc.manderley.com athlonpc
<ip_of_other_machines> <full_qualified_hostname> <short_hostame>

further more you may set in:
1) /etc/resolv.conf your DNS:
nameserver <ip> # first DNS server
nameserver <ip> # second DNS server

2) /etc/nsswitch eg. the search order for resolving hostname aliases.
eg.:
hosts: files dns # use /etc/hosts first, then DNS
(exchange them for vice versa)

 
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
LAN with no hosts :( will 18 Linux Networking 12 10-18-2006 11:39 PM
hosts file McHenry Linux Networking 2 06-08-2006 08:03 PM
hosts.deny and hosts.allow problem dan Linux Networking 3 06-15-2005 07:26 PM
/etc/hosts used only sometimes graeme.pietersz@gmail.com Linux Networking 2 03-09-2005 06:28 AM
Many Hosts via few Modems Walter Harms Linux Networking 5 01-20-2004 12:05 PM



1 2 3 4 5 6 7 8 9 10 11