LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-25-2009, 09:37 PM   #1
RileyTheWiley
Member
 
Registered: Dec 2007
Posts: 59

Rep: Reputation: 15
Machine does not know it's own name, but everyone else does


I have a fedora box that does not know who it is, but everyone else on the lan knows.

The basic idea is to have the machine with a local (LAN) name but not necessarily visible on the internet.

The box in question shall be called riley_linux for our purposes.
It has a friend, riley_xp, running windows. It is plugged into an ethernet hub and thence to a DSL router.

As it stands:
- riley_linux can browse the www. I am writing you from a browser on that machine.
- My xp machine can view and access smb shares on riley_linux, and vice versa.
- My xp machine can ping riley_linux by name and get an answer. It can also ping riley_linux's ip address and get an answer
- riley_linux can ping machines in the internet beyond the router by name.
- riley_linux can ping localhost and get an answer, either by name or by loopback ip address.

*********************************BUT***********************************
- ping riley_linux or ping riley_linux.localdomain always returns 'unknown host riley_linux'.

--and---

- riley_linux similarly fails to resolve riley_xp and other machines on the lan by name
***********************************************************************
What is going on?

Thanks very much.

Riley
 
Old 09-25-2009, 10:16 PM   #2
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 101Reputation: 101
Post the output of following commands:
hostname
cat /etc/hosts
 
Old 09-26-2009, 01:29 PM   #3
RileyTheWiley
Member
 
Registered: Dec 2007
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by quanta View Post
Post the output of following commands:
hostname
cat /etc/hosts
[riley@riley_linux trunk]$ hostname
riley_linux.localdomain
[riley@riley_linux trunk]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost localhost
127.0.0.1 todo
::1 localhost6.localdomain6 localhost6

[riley@riley_linux trunk]$
 
Old 09-26-2009, 01:33 PM   #4
RileyTheWiley
Member
 
Registered: Dec 2007
Posts: 59

Original Poster
Rep: Reputation: 15
Amazing the things you don't see ...

... even when they are in front of your nose:

[riley@riley_linux trunk]$ ping todo
PING todo (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.102 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.114 ms


So changing 'todo' to riley_linux should in theory make the machine pingable locally. I did notice, however, that 'ping todo' from the xp machine did not resolve the host, and there is no reason to think that entering a name for riley_linux there will make other hosts on the LAN resolve.

But it is a clue, no?

I read the man page on the hosts file (it might have been a good place to start) and it is clear enough how to assign a name to a machine with a static ip address. In my case however, all the machines are getting ip addresses through dhcp.

So I think the question now becomes: how to assign a hostname when the ip address is coming through DHCP?


Riley

Last edited by RileyTheWiley; 09-26-2009 at 01:52 PM.
 
  


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
not able to ping a machine but can do ssh to machine , wanna run vnc client amolgupta Linux - Software 4 07-28-2009 05:17 PM
mounting samba filesystem on remote machine as /home on local machine shishirkotkar Linux - Software 1 04-28-2008 05:05 AM
how to watch linux client machine desktop(activities) from windows machine deepak rawat Linux - Networking 7 07-03-2006 04:59 PM
how to shutdown,restart and log off windows machine remotely through a linux machine deepak rawat Fedora 1 05-23-2006 01:25 AM
sharing internet from a windows 98 machine to a Red Hat Linux machine ritwiksolutions Linux - Newbie 7 03-14-2006 10:20 AM

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

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