You are not logged in.

#1 2006-05-15 19:46:13

Cobra
Member
Registered: 2004-07-30
Posts: 109

ping IP vs. ping Hostname

Hello, I'm having a problem that's quite easy I think.

ping xxx.xxx.xxx.xxx gives a result but
ping hostname doesn't.

Does that have anything to do with DNS? Or netbios? I'm having this in /etc/resolv.conf
nameserver 192.168.0.1

That's the ip address of my hardware router. The client computers are using DHCP to get their ip addresses. I would like to communicate without looking the ip addresses up in the router manually...

Offline

#2 2006-05-15 19:56:34

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: ping IP vs. ping Hostname

ping hostname
that uses dns, or lm-names.
it first looks up the ip for hostname, then does the ping. be it dns or netbios that finds the name (os specific and name specific too).

ping xxx.xxx.xxx.xxx
that just pings the ip.

the question is..are you trying to get public sites?
ping www.google.com

or are you trying to ping local machines?


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2006-05-15 20:06:01

Cobra
Member
Registered: 2004-07-30
Posts: 109

Re: ping IP vs. ping Hostname

I'm trying to ping machines from the local network. Websites just work. smile (resolved via the DNS servers of the router)

Offline

#4 2006-05-15 20:09:40

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: ping IP vs. ping Hostname

for local machine names.. you either need to have local fqdn's..
like mymachine.localdomain.local
or something like that..and you can append a default search domain to all non-fqdn queries...

or you need windows short names..with netbios/lmhosts

for short names, you probably want samba. You might consider setting up a WINS server. That makes it a bit easier..


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2006-05-15 20:19:32

Cobra
Member
Registered: 2004-07-30
Posts: 109

Re: ping IP vs. ping Hostname

cactus wrote:

for local machine names.. you either need to have local fqdn's..
like mymachine.localdomain.local
or something like that..and you can append a default search domain to all non-fqdn queries...

or you need windows short names..with netbios/lmhosts

for short names, you probably want samba. You might consider setting up a WINS server. That makes it a bit easier..

Is the "mymachine.localdomain.local" entry the one that you have to put in /etc/hosts? I think that needs static ip's... or am I wrong there? Not sure...

Offline

#6 2006-05-15 20:41:59

fk
Member
From: Germany
Registered: 2006-04-29
Posts: 524

Re: ping IP vs. ping Hostname

The local router only forward the DNS Server to the DNS server from your ISP.

When you will ping hostnames, you must add static Ip's with Hostnames to your /etc/hosts, for all local PC's you will ping with hostnames.

Or you set up a local DNS server, but I think it is not that what you want wink

But why is it so bad to ping IP's


Have you tried to turn it off and on again?

Offline

#7 2006-05-15 20:58:36

Cobra
Member
Registered: 2004-07-30
Posts: 109

Re: ping IP vs. ping Hostname

DHCP is the reason it is so bad... the clients could be using a different IP address each day. I think it's a lot easier to just do this:

*ping computerA

instead of

*surfing to router config website
*clicking the dhcp link
*searching computerA with its IP address
*pinging found IP address

Offline

#8 2006-05-15 21:14:36

fk
Member
From: Germany
Registered: 2006-04-29
Posts: 524

Re: ping IP vs. ping Hostname

How many PC's have you in the Local network?

Why you dont make static IP's?


Have you tried to turn it off and on again?

Offline

#9 2006-05-15 21:25:16

Cobra
Member
Registered: 2004-07-30
Posts: 109

Re: ping IP vs. ping Hostname

I actually thought of that. That was the way I used to do it before, but I wanted to switch to DHCP because it's just easy... I mean, okay, it's not a lot of work to configure static addresses, but hey, DHCP just works fine. (altough I only have 4 computers in the network big_smile) - I know, it sounds silly...

I just can't imagine that huge companies have to search the ip-addresses of their computers before they can access them. big_smile

Offline

#10 2006-05-15 21:50:15

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: ping IP vs. ping Hostname

they dont.
they use dhcp to assign a hostname, then append it to local dns suffixes, then look them up that way.
dhcp working hand in hand with dns.

dnsmasq can do it

likely your $5 "router" can't is all.

as for short names. many windows centric companies either 1) use dns like above. 2) have a wins server. 3) have active directory (which is basically dns and wins rolled into a big ball of ****). 4) don't ping by short names. 5) pay someone like me to fix their network so they can.

muahahhahahaa


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#11 2006-05-16 14:32:22

Cobra
Member
Registered: 2004-07-30
Posts: 109

Re: ping IP vs. ping Hostname

Okay I can live with that. smile Thanks for your explanation. I think I'll just stick with static IP's then.

Offline

#12 2006-05-16 20:29:19

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,961

Re: ping IP vs. ping Hostname

Most dhcp servers have the option to use reservations.

You tell the dhcp server that a certain mac-address (networkcard id) always gets the same ip.

This way static ip-address combine nicely with dhcp.

Check the documentation for your router to find out how to set it up.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB