LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2005, 05:12 PM   #1
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Rep: Reputation: 30
find linux box by name vs. IP


On my network I have some win boxes and some linux boxes. You can ping a windows box by name: "ping server". It seems that you can only ping a linux box by IP, not name. I have changed two file in linux:

/etc/hosts/:
127.0.0.1 localhost.localdomain pensacola

/etc/sysconfig/network/
networking=yes
hostname=pensacola


My computer shows up by the name "pensacola" in say...windows explorer, but if I type "ping pensacola" it complains that it cannot find the box.


Is there an easy setting for me to fix or is this a whole big deep DNS thing that I don't want to mess with?
 
Old 08-12-2005, 05:21 PM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
you might try adding it to the windows hosts file, somewhere in the windows system32 folder (\drivers\etc, i think ).
 
Old 08-12-2005, 08:17 PM   #3
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
Each machine should have a hosts file. The linux boxes will have /etc/hosts and the windows boxes have c:\windows\system32\drivers\etc\hosts

Both windows and linux versions of the hosts file are the same.

ip_address machine_name

Once you have this set up on all your machines you will be able to ping from any machine using the machine name.
 
Old 08-12-2005, 10:14 PM   #4
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
otherwise you need to use DNS. I've never really messed w/ DNS(I have a small network for my cluster). go with the hosts file, it'll work better for your needs
 
Old 08-14-2005, 05:47 PM   #5
zchoyt
Member
 
Registered: Feb 2003
Location: Boise ID
Distribution: fedora
Posts: 156

Original Poster
Rep: Reputation: 30
So if my linux box is on DHCP, then I'll have to use some sort of DNS?

Static would be no problem at home, but I am thinking of work where they dish out dynamic IPs. It'll be such a pain! They give out dynamic IP's, but to participate in much of anything I'd have to get on thier domain and they don't support linux. Oh well, it looks like I'll just have to store the IP to a network file at logon....?..
 
Old 08-14-2005, 08:10 PM   #6
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
DHCP is not DNS. DHCP will give out ip address'(I don't know how to set this up). DNS will give a name to the ip address. DNS is used for all internet domains(www.yahoo.com). On a small network, it'd be easier to set up the hosts file, so that you don't have to configure DHCP
 
Old 08-15-2005, 10:24 PM   #7
/bin/bash
Senior Member
 
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
The hosts file is not for computers with dynamic ip's. What you use the hosts file for mostly is setting up your LAN. You have all your computers setup with private ip's e.g. 192.168.X.X or 10.X.X.X etc... So you have one hosts file with all the IP's and hostnames and each computer on the LAN has a copy of the hosts file and they all know each others local IP/hostname.

When you want to access a computer on the internet is when you need a DNS server. And the file /etc/resolv.conf will have the IP address of your DNS servers.

If your LAN at work uses DHCP then you need to have a local DNS server. If you dont then you'll need to use something like nmap to locate the other computers. But unless you have hundreds of computers that shouldn't be to difficult
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
WinXP does not find Linux Box in Network noordwijk Linux - Networking 6 08-05-2005 11:05 PM
How to find a name of Linux box! ardi76 Linux - Software 4 08-28-2003 03:07 PM
How can I find out the users setup on a Linux box R4z0r Linux - General 4 06-28-2003 11:32 AM
windows cant find linux box manthram Linux - Networking 4 03-31-2002 11:30 PM
What's up with this - Netscape can't find Linux Box (Pop3) pponchot Linux - Networking 1 10-06-2001 10:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration