LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-03-2016, 08:01 PM   #1
jcamez
LQ Newbie
 
Registered: Oct 2006
Location: Guaymas, Sonora, Mexico
Distribution: Slackware Stable
Posts: 23

Rep: Reputation: 1
Ping Hosts by Name not Working 14.2


Hi guys!!

I have a problem with Slackware 14.2.

In 14.1 i could ping other conmputers in my lan by its host name instead of the ip.

I added "wins" to the line "hosts: files dns" in /etc/nsswitch.conf. and "yes" to the line "wins support =" in /etc/samba/smb.conf.

But now in 14.2, after making this changes, i still can't ping hosts by its name, and because i use dhcp i have to find the ip in each host so i can acces with remote clients or share files.

Any one has seen this en 14.2??

Thanks in advance.
 
Old 08-03-2016, 08:27 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I know this doesn't solve your problem, but another option might be found within your router. Many routers will allow you to assigned "static" IPs through the dhcp based on the MAC address (on my router running dd-wrt, it is called "static leases" and is found under the "Services" tab). I put in my computer's MAC address into the router and pick an IP within the valid range, then when I use dhcp on my computer, my computer will get the IP I told the router.

I have this for all my computers except for my wife's iPhone (since I never need to connect to that).

With that being said, hopefully someone else can help you figure out the name problem.
 
Old 08-04-2016, 03:19 AM   #3
zk1234
4MLinux Maintainer
 
Registered: Oct 2010
Location: Poland
Distribution: 4MLinux, Slackware
Posts: 1,254

Rep: Reputation: 220Reputation: 220Reputation: 220
1) Make sure that you have your router's dynamic IP in /etc/resolv.conf. If, for example, you have 8.8.8.8 there, then obviously Google knows nothing about your internal home network (at least I hope so :-)
2) Alternatively, you can also edit /etc/hosts by adding new lines to this file, for example:
192.168.1.7 teddy.laptop

.

Last edited by zk1234; 08-04-2016 at 03:35 AM.
 
Old 08-04-2016, 05:23 AM   #4
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Just leaving there:
Code:
bash-4.3# ping http://www.google.com
ping: unknown host http://www.google.com
bash-4.3#
That's on a bare installation of Slackware 14.2 on a Virtual Machine, where you can perfectly access the Google on Firefox or Konqueror. No more than a VM because looks like all my existent computers have strong opinions against this release and there are no money and will to buy yet another one, wondering if it will work with.

PS. I would like to say Sorry!!! if this console excerpt insult someone!

Last edited by Darth Vader; 08-04-2016 at 05:28 AM.
 
Old 08-04-2016, 06:49 AM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Funny how 'ping' fails on port 80.
Perhaps 'ping -c2 www.google.com'?

Last edited by allend; 08-04-2016 at 06:57 AM.
 
Old 08-04-2016, 06:58 AM   #6
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Quote:
Originally Posted by allend View Post
Funny how 'ping' fails on port 80.
Perhaps 'ping -c2 www.google.com'?
Code:
bash-4.3# ping https://www.google.com
ping: unknown host https://www.google.com
bash-4.3# 

bash-4.3# ping -c2 https://www.google.com
ping: unknown host https://www.google.com
bash-4.3#
PS. I would like to say Sorry!!! if this console excerpt insult someone!

Last edited by Darth Vader; 08-04-2016 at 06:59 AM.
 
Old 08-04-2016, 07:03 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
I am not insulted, merely amused.
P.S. Consider TCP versus ICMP
 
Old 08-04-2016, 07:10 AM   #8
Darth Vader
Senior Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 2,727

Rep: Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247Reputation: 1247
Oh, again, sorry!

Code:
bash-4.3# ping www.google.com
ping: unknown host www.google.com
bash-4.3#
That's better?
 
Old 08-04-2016, 07:40 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
bash-4.3$ ping -c2 www.google.com
PING www.google.com (172.217.25.164) 56(84) bytes of data.
64 bytes from www.google.com (172.217.25.164): icmp_seq=1 ttl=52 time=16.8 ms
64 bytes from www.google.com (172.217.25.164): icmp_seq=2 ttl=52 time=15.7 ms

--- www.google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 15.702/16.251/16.800/0.549 ms
No problem with DNS here.

Last edited by allend; 08-04-2016 at 07:42 AM.
 
Old 08-04-2016, 09:12 PM   #10
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
What does "ping" have to do with DNS lookup anyways?
Code:
cranium@toshiba:~$ host www.google.com
www.google.com has address 74.125.21.103
www.google.com has address 74.125.21.106
www.google.com has address 74.125.21.104
www.google.com has address 74.125.21.105
www.google.com has address 74.125.21.99
www.google.com has address 74.125.21.147
www.google.com has IPv6 address 2607:f8b0:4002:c06::69
cranium@toshiba:~$ uname -a
Linux toshiba 4.4.14 #1 SMP Fri Jun 24 13:30:15 CDT 2016 x86_64 Intel(R) Pentium(R) CPU B940 @ 2.00GHz GenuineIntel GNU/Linux
cranium@toshiba:~$
 
Old 08-05-2016, 03:54 AM   #11
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
What does "ping" have to do with DNS lookup anyways?
Code:
bash-4.3$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 211.29.132.12
nameserver 198.142.0.51
and excerpt from /strace ping -c2 www.google.com'
Code:
socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("211.29.132.12")}, 16) = 0

Last edited by allend; 08-05-2016 at 04:13 AM. Reason: Formatting
 
1 members found this post helpful.
Old 08-05-2016, 04:25 AM   #12
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
jcamez --

Since you mentioned WINS in your original post, I have to ask ...

Is smb running on the 14.2 box ?

Code:
ps -ef |grep smb
Or do you have a firewall running ?

If so, I believe WINS wants to chat on port 137 {?}

HTH

-- kjh
 
Old 08-05-2016, 02:32 PM   #13
jcamez
LQ Newbie
 
Registered: Oct 2006
Location: Guaymas, Sonora, Mexico
Distribution: Slackware Stable
Posts: 23

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by bassmadrigal View Post
I know this doesn't solve your problem, but another option might be found within your router. Many routers will allow you to assigned "static" IPs through the dhcp based on the MAC address (on my router running dd-wrt, it is called "static leases" and is found under the "Services" tab). I put in my computer's MAC address into the router and pick an IP within the valid range, then when I use dhcp on my computer, my computer will get the IP I told the router.

I have this for all my computers except for my wife's iPhone (since I never need to connect to that).

With that being said, hopefully someone else can help you figure out the name problem.
Hi bassmadrigal.
I want to leave that as a last resort.

It really confuses me why it was working in 14.1 and not working in 14.2 making the same changes.
What has changed??

thanks.
 
Old 08-05-2016, 02:34 PM   #14
jcamez
LQ Newbie
 
Registered: Oct 2006
Location: Guaymas, Sonora, Mexico
Distribution: Slackware Stable
Posts: 23

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by zk1234 View Post
1) Make sure that you have your router's dynamic IP in /etc/resolv.conf. If, for example, you have 8.8.8.8 there, then obviously Google knows nothing about your internal home network (at least I hope so :-)
2) Alternatively, you can also edit /etc/hosts by adding new lines to this file, for example:
192.168.1.7 teddy.laptop

.
1) My /etc/resolv.conf shows the corresponding lines of my router.

" ##Generated by NetworkManager
nameserver 200.52.162.137
nameserver 200.52.160.200
nameserver 200.77.146.137 "

2) i have think of that, but then i would have to add a line every time my ip changes right??

Thanks.
 
Old 08-05-2016, 02:36 PM   #15
jcamez
LQ Newbie
 
Registered: Oct 2006
Location: Guaymas, Sonora, Mexico
Distribution: Slackware Stable
Posts: 23

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Darth Vader View Post
Just leaving there:
Code:
bash-4.3# ping http://www.google.com
ping: unknown host http://www.google.com
bash-4.3#
That's on a bare installation of Slackware 14.2 on a Virtual Machine, where you can perfectly access the Google on Firefox or Konqueror. No more than a VM because looks like all my existent computers have strong opinions against this release and there are no money and will to buy yet another one, wondering if it will work with.

PS. I would like to say Sorry!!! if this console excerpt insult someone!
Pinging google works ok..

Code:
bash-4.3# ping www.google.com
PING www.google.com (173.194.219.99) 56(84) bytes of data.
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=1 ttl=41 time=109 ms
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=2 ttl=41 time=108 ms
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=3 ttl=41 time=109 ms
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=4 ttl=41 time=109 ms
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=5 ttl=41 time=108 ms
64 bytes from ya-in-f99.1e100.net (173.194.219.99): icmp_seq=6 ttl=41 time=117 ms
^C
--- www.google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 108.199/110.303/117.093/3.073 ms
bash-4.3#
Thanks..
 
  


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
[SOLVED] Can ping Ubuntu hosts but not Debian hosts by hostnames garyozzy Linux - Networking 6 03-09-2012 10:32 AM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
can't ping local IP address but can ping remote hosts rob_xx17 Linux - Networking 4 12-02-2006 08:39 AM
dhcp client can't ping gateway but can ping other local hosts dirty_forks Linux - Networking 7 10-08-2004 10:54 AM
RH 7.2 - Can't ping other hosts spato Linux - Networking 8 05-04-2002 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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