LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools
Old 01-02-2004, 11:43 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240
Thanked: 0
naming problem for linux


[Log in to get rid of this advertisement]
i have a linux box named ximian, but on my network from a different machine, can't just type "ping ximian" , have to put in my machine's ip such as "ping 192.168.1.10".

How to fix it so my machine name will match the ip (if that's the correct way to put it)? I ready tried to edit /etc/sysconfig/network, didn't seem to work
feetyouwell is offline     Reply With Quote
Old 01-03-2004, 12:46 AM   #2
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237
Thanked: 0
your hostname - ip resolution is host dependent and machine dependent you can edit the hosts file (win2k + or lin) in etc/hosts and a line to resolve it, or setup the networds host to resolve the name correctly..
miaviator278 is offline     Reply With Quote
Old 01-03-2004, 01:01 AM   #3
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Kwajalein
Distribution: Slackware, Ubuntu, Vista & XP
Posts: 1,560
Thanked: 0
Quote:
Originally posted by miaviator278
your hostname - ip resolution is host dependent and machine dependent you can edit the hosts file (win2k + or lin) in etc/hosts and a line to resolve it, or setup the networds host to resolve the name correctly..
I'm pretty sure the original poster is going
Ok, well, I am.
itsjustme is offline     Reply With Quote
Old 01-03-2004, 01:43 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,058
Thanked: 1
No scratchy heads allowed!
What he said was, you need to edit the hosts file to include the machine name and related ip addrress. That is true in Windows or Linux when you don't have a dns or wins server to do it for you.

If the other machine is a Linux box, edit the /etc/hosts file. For example....
127.0.0.1 localhost.localdomain localhost
192.168.0.1 computer1.workgroup computer1
192.168.0.2 computer2.workgroup computer2


If the other computer is a Windows box, edit the hosts file which can be located differently depending on the version of Windows. The easiest thing to do is search for hosts and open it up with notepad from the search results unless you know exactly where it is.
For example......
127.0.0.1 localhost
192.168.0.1 computer1.workgroup
192.168.0.2 computer2.workgroup

Make sure to save that as a plain hosts file with no extensions by enclosing the name in quotes..... "hosts"
homey is offline     Reply With Quote
Old 01-03-2004, 02:16 AM   #5
Mugatu
Member
 
Registered: Dec 2003
Location: VA
Distribution: Ubuntu and Mandriva
Posts: 192
Thanked: 0
i was wondering the same thing. my question is...on my home lan, i don't have to edit any hosts files or anything, but my windows machines automatically resolve the names. why won't my linux machines do it?

at work, the linux machines automatically seem to resolve hostnames for windows machines, but i can't ping one linux machine from another by typing "ping <HOSTNAME>". none of it makes sense to me...
Mugatu is offline     Reply With Quote
Old 01-03-2004, 02:40 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,058
Thanked: 1
I'm no expert on Windows but I think they are using Netbios to resolve names. I don't think Linux does that.
homey is offline     Reply With Quote
Old 01-03-2004, 07:20 AM   #7
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234
Thanked: 0
hosts

Mugatu, is your win2k boxes using linux as your dns servers? if so, there's your answer. At work, it depends where the linux boxes are pointing to dns wise. (/etc/resolv.conf) If it's a windows domain, your Domain Controller (DC) is probably the DNS server as well and has the names of all your workstations on it. The linux machines probably aren't part of the domain so the DC has no knowledge of what the hostnames of the linux servers are.

There's multiple answers as to why, but there's a few possbilities.

miaviator278, Greetings from Operation: Enduring Freedom. I'll hit the other major operation in the fall. Oohrah, Marine Corps.
Blindsight is offline     Reply With Quote
Old 01-04-2004, 11:34 PM   #8
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237
Thanked: 0
sorry, didn't intend confusion, thanks for clearing it up.

yes windows uses netbois by default also most companys have wins/dns servers setup to handle their intranets.
miaviator278 is offline     Reply With Quote
Old 02-02-2004, 02:33 PM   #9
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210
Thanked: 0
Quote:
Originally posted by Mugatu
i was wondering the same thing. my question is...on my home lan, i don't have to edit any hosts files or anything, but my windows machines automatically resolve the names. why won't my linux machines do it?

at work, the linux machines automatically seem to resolve hostnames for windows machines, but i can't ping one linux machine from another by typing "ping <HOSTNAME>". none of it makes sense to me...

im in the same boat. take two winxp boxes, network them together (no dns/wins hosts edit) and they can ping each other by machine name.

put a lin box and and a winbox together, and they can only ping by IP address.

I've figured out how to get the windows box to ping the linux box by machine name. With samba, you can set up a netbios name (edit smb.conf, add netbios name = yourcomputername, and restart samba).

I still can't ping my windows box by machine name from linux though.

Does linux simply not work with netbios broadcasts? Do you HAVE to set up WINS or DNS, or edit the hosts file? It seems odd that you can give your box a netbios name through samba, but you can't see other netbios names without a wins server.

and when i run

# nmblookup windowsbox

it resolves to the correct ip of the win machine.

any thoughts?

thanks,

Murray
murray_linux is offline     Reply With Quote
Old 03-25-2004, 04:47 AM   #10
wensveen
LQ Newbie
 
Registered: Mar 2004
Location: Utrecht, Netherlands
Distribution: Debian unstable
Posts: 20
Thanked: 0
Same thing here.
At home I have two Linux boxes connected to the network of my company that uses a Win2K domain controller (dchp & dns).
The difficulty is that I'm not allowed to join the domain of my company's network. Other linux boxes on the company network that are in the domain are added to the dns by the domain controller.
I really don't want to edit /etc/hosts because I think that's a workaround, not a solution.

The best solution would be to make dig and host (and nslookup) to use wins (when configured). I'd do it myself if I knew how....
wensveen is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
Arch Linux hard disk naming reddazz Arch 15 04-22-2005 04:39 AM
Interface naming Gibsonist Linux - Networking 6 03-17-2005 12:25 AM
mail server the naming naming convention problem kashan Linux - Newbie 0 07-16-2004 03:08 PM
samba / naming networking problem mehesque Linux - Networking 13 03-12-2004 10:58 PM
kernel naming thanko Linux - General 4 04-25-2002 03:59 PM


All times are GMT -5. The time now is 05:51 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration