LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-02-2004, 10:43 PM   #1
feetyouwell
Member
 
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
naming problem for linux


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
 
Old 01-02-2004, 11:46 PM   #2
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237

Rep: Reputation: 30
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..
 
Old 01-03-2004, 12:01 AM   #3
itsjustme
Senior Member
 
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
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.
 
Old 01-03-2004, 12:43 AM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
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"
 
Old 01-03-2004, 01:16 AM   #5
Mugatu
Member
 
Registered: Dec 2003
Location: VA
Distribution: Ubuntu
Posts: 193

Rep: Reputation: 30
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...
 
Old 01-03-2004, 01:40 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
I'm no expert on Windows but I think they are using Netbios to resolve names. I don't think Linux does that.
 
Old 01-03-2004, 06:20 AM   #7
Blindsight
Member
 
Registered: Mar 2003
Distribution: Slackware
Posts: 234

Rep: Reputation: 30
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.
 
Old 01-04-2004, 10:34 PM   #8
miaviator278
Member
 
Registered: Dec 2003
Location: Al-Diwania, Iraq (deployed)
Distribution: Slackware ONLY
Posts: 237

Rep: Reputation: 30
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.
 
Old 02-02-2004, 01:33 PM   #9
murray_linux
Member
 
Registered: Nov 2003
Distribution: Slackware Current
Posts: 210

Rep: Reputation: 30
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
 
Old 03-25-2004, 03:47 AM   #10
wensveen
LQ Newbie
 
Registered: Mar 2004
Location: Utrecht, Netherlands
Distribution: Debian unstable
Posts: 20

Rep: Reputation: 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....
 
  


Reply



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

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

All times are GMT -5. The time now is 06:49 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