LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-17-2004, 04:26 PM   #1
tcma
Member
 
Registered: Aug 2004
Distribution: gentoo, Fedora Core
Posts: 54

Rep: Reputation: 15
ping: unknown host www.google.com


How to setup networking so ping will work?

# ping -c 2 www.google.com
ping: unknown host www.google.com

However, ping works with IP addresses.
# ping -c 2 64.233.161.99
PING 64.233.161.99 (64.233.161.99) 56(84) bytes of data.
64 bytes from 64.233.161.99: icmp_seq=1 ttl=239 time=38.1 ms
64 bytes from 64.233.161.99: icmp_seq=2 ttl=239 time=37.5 ms

--- 64.233.161.99 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 37.583/37.845/38.108/0.326 ms

Linux version 2.6.7-gentoo-r11

Last edited by tcma; 08-17-2004 at 04:27 PM.
 
Old 08-17-2004, 04:30 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Add your ISPs DNS servers to /etc/resolv.conf in the format:
nameserver ip.of.primary.dns
nameserver ip.of.secondary.dns
 
1 members found this post helpful.
Old 06-11-2011, 03:49 AM   #3
Mirceagab
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
Following file should be work with any ISP in the world
# cat /etc/resolv.conf
Output:

nameserver 208.67.220.220
nameserver 208.67.222.222
 
Old 06-11-2011, 10:28 AM   #4
kprojects
LQ Newbie
 
Registered: Sep 2008
Posts: 6

Rep: Reputation: 0
I'll usually use google's dns..

nameserver 8.8.8.8
nameserver 8.8.4.4
 
Old 07-22-2011, 11:41 AM   #5
NetDoc
Member
 
Registered: Sep 2007
Posts: 50

Rep: Reputation: 0
Quote:
Originally Posted by kprojects View Post
I'll usually use google's dns..

nameserver 8.8.8.8
nameserver 8.8.4.4
Here is what I get:

root@epsilon:~# ping google.com
ping: unknown host google.com
root@epsilon:~#

I have this in my resolv.conf:
File: /etc/resolv.conf

search sblb1.scubaboard.com
nameserver 192.168.2.1
nameserver 8.8.8.8
nameserver 8.8.4.4
 
Old 07-22-2011, 11:51 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,504

Rep: Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884Reputation: 884
Remove
Code:
search sblb1.scubaboard.com
nameserver 192.168.2.1
And restart the network

Kind regards
 
Old 03-02-2012, 10:14 PM   #7
Galatimas
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Similar issue

Hey folks. I've just started playing with linux over the past couple days, so I'm clearly having some trouble.

I have the same issue. At first it was just that the system couldn't get to the internet, but I wrote a static default route and it works fine (not sure how pertinent that is, but perhaps shows some setup issue). My IP settings are all static. Currently I can't ping/traceroute/wget any domain names and programs can't use them either.

nslookup/dig work. Ping just gives "ping: unknown host google.com"

# nslookup google.com
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: google.com
Address: 74.125.226.192

# ping 74.125.226.196
PING 74.125.226.196 (74.125.226.196) 56(84) bytes of data.
64 bytes from 74.125.226.196: icmp_req=1 ttl=54 time=18.7 ms
64 bytes from 74.125.226.196: icmp_req=2 ttl=54 time=17.4 ms


Resolv.conf contents:

# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4



nsswitch.conf contents:

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat

hosts: dns files
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files




Linux version 2.6.32-5-686
 
Old 03-02-2012, 11:47 PM   #8
Galatimas
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
I'm an idiot...

So yeah, apparently if you tab out the lines in the resolv.conf file for the nameservers for neatness' sake, it doesn't work right.

my resolv.conf had:
#yadayadaydayda
<tabbed space> nameserver 8.8.8.8
<tabbed space> nameserver 8.8.4.4

____________________________________________________________________________________________________

Deleted the tabbed space before the nameserver directive and it works fine now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
difference between www.google.com/linux and www.google.com dr_zayus69 General 4 01-12-2005 02:45 PM
Still can't ping www.google.com Wyk3d Linux - Networking 1 11-07-2004 01:17 PM
ping: unknown host in local intranet linuxjustin Linux - Networking 3 04-04-2004 02:03 PM
Resolver problem: ping localhost.localdomain gives Unknown host rmd Linux - Networking 0 11-06-2003 07:58 AM
Unknown Host <Linuxmachinename> / Unable to ping by host name nishi_k_79 Linux - Networking 4 11-01-2003 01:24 PM


All times are GMT -5. The time now is 11:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration