Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: bitsnbytes on April 28, 2011, 03:09:40 PM

Title: Cannot ping to tinycore by hostname
Post by: bitsnbytes on April 28, 2011, 03:09:40 PM
I booted off a live cd and installed to hard drive using the instructions here  (http://distro.ibiblio.org/tinycorelinux/install.html). The install went through perfect and I'm able to boot via hard disc now. I also added the boot option to menu.lst to change the hostname from the default 'box'
Code: [Select]
kernel /boot/bzImage quiet host=tinycorepc

However, I cannot ping from an external system using the hostname but I can ping using the ip address :(
If I ping on the tinycore system itself it gives me the output below

Code: [Select]
ping tinycorepc
PING tinycorepc (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.074ms

The resolved ip is different to the one assigned by the dhcp server (192.168.1.32 and I ping using this ip). What do I change so I can ping via hostname, I'm sure it must be something simple, but I'm not so proficient in linux :(
Title: Re: Cannot ping to tinycore by hostname
Post by: curaga on April 28, 2011, 03:26:52 PM
That's completely normal behavior? Windows pc's can scan each other, and some combined dns/dhcp servers add the hostname to dns, but most don't.
Title: Re: Cannot ping to tinycore by hostname
Post by: gerald_clark on April 28, 2011, 03:27:26 PM
You need a local name server and a dhcp server that updates it.
Your other option is to put all machines in the hosts file on each machine.
Title: Re: Cannot ping to tinycore by hostname
Post by: tinypoodle on April 28, 2011, 03:35:28 PM
Code: [Select]
ping tinycorepc
PING tinycorepc (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.074ms

That's ping'ing a local loopback   ;)
Title: Re: Cannot ping to tinycore by hostname
Post by: bitsnbytes on April 28, 2011, 03:37:00 PM
So does it mean that this is not possible?  ???
Title: Re: Cannot ping to tinycore by hostname
Post by: gerald_clark on April 28, 2011, 03:38:50 PM
Read reply #2.
Title: Re: Cannot ping to tinycore by hostname
Post by: bitsnbytes on April 28, 2011, 03:44:58 PM
You need a local name server and a dhcp server that updates it.
I think the router is definitely capable of it since I can ping my local NAS server (netgear readynas which is unix) using the hostname.

Your other option is to put all machines in the hosts file on each machine.
Do you mean on the windows pc trying to ping the tinycorepc? That would be a pain since I have quite a few windows pcs :( and besides if it does work for my nas then why not for tinycore :(
Title: Re: Cannot ping to tinycore by hostname
Post by: gerald_clark on April 28, 2011, 03:48:04 PM
Your nameserver needs to know the name and IP of your tinycore.
Title: Re: Cannot ping to tinycore by hostname
Post by: bitsnbytes on April 28, 2011, 03:54:05 PM
resolv.conf reports
Code: [Select]
search lan
nameserver 192.168.1.254

192.168.1.254 is the default gateway. Is there anyway to find out the nameserver ip address? Is this different to the dhcp server?

What confuses me is that in my nas I just set the host name and it worked fine after a reboot, didn't have to do anything special to the windows pc. Is there anything I can check on the nas (to replicate settings)?
Title: Re: Cannot ping to tinycore by hostname
Post by: tinypoodle on April 28, 2011, 04:26:36 PM
resolv.conf shows nameserver aquired by dhcp.
Title: Re: Cannot ping to tinycore by hostname
Post by: bitsnbytes on April 28, 2011, 04:31:36 PM
It's getting all too confusing, best left alone I guess :(
Title: Re: Cannot ping to tinycore by hostname
Post by: combo3 on May 02, 2011, 12:18:32 AM
Without DNS, the only way for Windows computers to find your tinycore box is to install and run nmbd and smbd (which requires Samba3.tcz).

Add (or change) the following stanzas under [global] in /usr/local/etc/samba/smb.conf:

workgroup = YourWorkgroupName
netbiosname = tinycorepc

hosts allow = 192.168.1. 192.168.2. 127. {remove the ";"}

Then run testparm and fix any errors.

Then run sudo /usr/local/etc/init.d/samba start

Your tinycore pc should now show up as part of the network on the Windows machines.
Title: Re: Cannot ping to tinycore by hostname
Post by: Juanito on May 02, 2011, 12:22:42 AM
I'd have thought you would need local name resolution running to be able to ping by hostname from a windows (or a linux) box?
Title: Re: Cannot ping to tinycore by hostname
Post by: combo3 on May 02, 2011, 01:38:43 AM
Yep, on a local peer-peer network you can use NetBios over TCP/IP for name resolution to avoid editing the hosts file on every machine as suggested in reply #2 (which is a royal PITA to maintain).

Title: Re: Cannot ping to tinycore by hostname
Post by: gerald_clark on May 02, 2011, 01:51:04 AM
Why not just run dnsmasq?
Title: Re: Cannot ping to tinycore by hostname
Post by: Juanito on May 02, 2011, 01:58:56 AM
I'm not at home at the moment to double-check, but I enabled netbios over tcp on the windows machines on the network - they might be able to ping each other, but they cannot ping the linux (tc) machine running samba by hostname and it cannot ping them..
Title: Re: Cannot ping to tinycore by hostname
Post by: Juanito on May 02, 2011, 02:01:19 AM
Why not just run dnsmasq?

I've always wondered how to set it up to resolve local hostnames and nothing else (i.e. let the router do everything else)?

I used to have a hacked router that used dnsmasq to resolve local hostnames, but I never found out how it was configured.