ping IP name works - ping domain name does NOT work???

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
GruenSpecht

ping IP name works - ping domain name does NOT work???

Post by GruenSpecht »

Dear all

Linux Mint 13 (32 bit) MATE: I have a broken internet connection - neither browser, apt-get nor email works on one of my netbooks (Toshiba NB520). However did work fine in the past, so assume hardware is not the issue here.

I am connected to the WiFi router - and the console command "ping IP address" works (e.g. ping 173.194.35.146, which is http://www.google.com) - it returns acceptable response times of 20 ms with no lost packages. But, if I try to "ping http://www.google.com" as a command, it returns error message: "ping: unknown host http://www.google.com" ???

So the error has something to do with the domain name not to be translated into the IP address? Which I assume is the reason why I have the above said broken internet connection for email, browser and command apt-get, etc...

This error exists both for wlan0 and eth0 (WifI and network cable) connection, while another computer (the one I am currently working on) does work fine under said Linux Mint 13, 32 bit with the same router connections?

How to fix this - or do I have to reinstall?

Your answers would be much appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
karlchen
Level 23
Level 23
Posts: 18238
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: ping IP name works - ping domain name does NOT work???

Post by karlchen »

Hello, GruenSpecht.

Open a terminal window and execute these commands:

Code: Select all

ls -l /etc/resolv.conf
It should be symlink and point to /var/run/resolvconf/resolv.conf.

Code: Select all

ls -l /var/run/resolvconf/resolv.conf
It should exist and not be empty.

Code: Select all

cat /var/run/resolvconf/resolv.conf
It should hold a minimum of these lines

Code: Select all

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search name_of_your_router
You might try adding a third party DNS server to the list, e.g. 8.8.8.8, by editing the file /etc/resolvconf/resolv.conf.d/tail with root privileges. If the file does not exist create it.

Code: Select all

gksu gedit /etc/resolvconf/resolv.conf.d/tail
Put just this line in the file:

Code: Select all

nameserver 8.8.8.8
Next restart your networking service:

Code: Select all

sudo service network-manager stop
sudo service network-manager status
sudo service network-manager start
sudo service network-manager status
Check whether DNS resolution works correctly now:

Code: Select all

nslookup google.com
HTH,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
GruenSpecht

Re: ping IP name works - ping domain name does NOT work???

Post by GruenSpecht »

Dear karlchen,

this gave me a hard time - as I am still a linux novice.

Your line:
<< ls -l /etc/resolv.conf[/code] it should be symlink and point to /var/run/resolvconf/resolv.conf. >>

perhaps should be read as /etc/resolvconf (as there is no "." between "resolv" and "conf")?

<< You wrote: It should be symlink and point to /var/run/resolvconf/resolv.conf >>

I did not locate any such file in my directory neither by terminal command ls -l nor in my file manager (Caja 1.2.1). What I found was /var/run/resolvconf/interface/postponed-update (size 0 bytes, dated 23. Sept 2013 = today). Did try to open it also using sudo ls -l /var/run/resolvconf/interface; returned with: "total 0".

What I found under /etc/resolvconf/ was the file /etc/resolvconf/resolv.conf.d/... with the files /etc/resolvconf/resolv.conf.d/base (size 0 bytes); /etc/resolvconf/resolv.conf.d/head (size 151 bytes) which contained the said lines: # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN however no other lines (no reference of nameserver 127.0.0.1 or search name_of_your_router[/code])! I introduced these both lines even if they may be overwritten... just in case it may help.
I introduced the file tails with nameserver 8.8.8.8 in it and restarted networking service - however no effect. The command nslookup http://www.google.com resulted in teh error message "The domain http://www.google.com was not found, eror message: ;; connection timed out; no servers could be reached." The same error message came with nslookup 173.194.35.146??? However ping 173.194.35.146 it did work (!!!) and returned transmitted packages with no reported errors!

"Riddles in the dark...?"
Thanks for your help, anyway... karlchen (I did learn a lot on how things should work as I tried them in parallel on my other PC.)
DrHu

Re: ping IP name works - ping domain name does NOT work???

Post by DrHu »

GruenSpecht wrote:I am connected to the WiFi router - and the console command "ping IP address" works (e.g. ping 173.194.35.146, which is http://www.google.com) - it returns acceptable response times of 20 ms with no lost packages. But, if I try to "ping http://www.google.com" as a command, it returns error message: "ping: unknown host http://www.google.com" ???
First, I have no idea what these statement means (are they the same or are they different: which console (terminal?? )
  • I am connected to the WiFi router - and the console command "ping IP address" works..
    But, if I try to "ping http://www.google.com" as a command, it returns error message..
The easiest thing to do is to run some of the networking commands available in Linux and detect your anomolies
https://wiki.archlinux.org/index.php/Wireless_Setup
--archlinux usually has good/detailed methods presented, you woul follow step-by-step and you will definitely get somewhere

Look at your router web page setup or the GUI network manager in your Linux versions and see exactly what is being done with devices and IP addresses (and of course dhcp for auto IP assignemnet and DNS lookups..)

You have also given no information about your router brand/model #
--which would direct you to their web page addressing for that specific router
  • Usually it is 192.168.xxx.xxx
    --the router manufacturer uses a specific IP web page assigment
http://compnetworking.about.com/od/workingwithipaddresses/f/getrouteripaddr.htm
User avatar
karlchen
Level 23
Level 23
Posts: 18238
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: ping IP name works - ping domain name does NOT work???

Post by karlchen »

Hello, GruenSpecht.
Your line:
<< ls -l /etc/resolv.conf[/code] it should be symlink and point to /var/run/resolvconf/resolv.conf. >>
perhaps should be read as /etc/resolvconf (as there is no "." between "resolv" and "conf")?
Not confirmed. It should read exactly as I typed it. No typing error.

Code: Select all

$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 31 Okt 25  2012 /etc/resolv.conf -> /var/run/resolvconf/resolv.conf
This would have been the result ideally.
<< You wrote: It should be symlink and point to /var/run/resolvconf/resolv.conf >>
I did not locate any such file in my directory
This may well be a hint that there is a problem. DNS - domain name resolution - has not been configured correctly or not at all on your machine. As a rule you will use your router as your DHCP server. I.e. it will assign a valid IP to your machine.
In addition it will serve as your primary DNS server and will, unless misconfigured, pass on any DNS query to the DNS servers of your internet provider and pass the answer back to your machine. This does not seem to happen on your machine. :?

The content of the missing file should be

Code: Select all

$ cat /var/run/resolvconf/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search fritz.box
The content of the last line depends on your DSL router and is of no real interest with respect to name resolution of internet domain names.
/etc/resolvconf/resolv.conf.d/head (size 151 bytes) which contained the said lines:

Code: Select all

# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
[..] I introduced these both lines even if they may be overwritten
The author of the file may have got a good reason to tell you not to tamper with this file. :roll:

Code: Select all

The command nslookup http://www.google.com resulted in teh error message "The domain http://www.google.com was not found,
The command does not prefix "http://" to "www.google.com". http:// is not part of the name, but specfies the protocol http. So be prefixing http:// you rendered the nslookup command useless. Again the command to run was

Code: Select all

nslookup google.com
With respect to further steps, I suggest to follow DrHu's advice.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
GruenSpecht

Re: ping IP name works - ping domain name does NOT work???

Post by GruenSpecht »

Dear Karlchen,

when typing your commands into my (working) PC NB06 - Linux Mint 13 (32 bit/ Mate/= XXX@NB06, with XXX = blank) with a perfectly working internet connection and routing over the same router/ line into the internet as my "broken" Toshiba NB520, I get the following results:

XXX@NB06 ~ $ ls -l /etc/resolv.conf
ls: cannot access /etc/resolv.conf: No such file or directory
XXX@NB06 ~ $ sudo ls -l /etc/resolv.conf
[sudo] password for XXX:
ls: cannot access /etc/resolv.conf: No such file or directory
???

same for your next line:
XXX@NB06 ~ $ ls -l /var/run/resolvconf/resolv.conf
ls: cannot access /var/run/resolvconf/resolv.conf: No such file or directory
XXX@NB06 ~ $ ls -l /var/run/resolvconf/resolv.conf
ls: cannot access /var/run/resolvconf/resolv.conf: No such file or directory
??? What is it I do wrong?

Your next command line results in:
XXX@NB06 ~ $ cat /var/run/resolvconf/resolv.conf
cat: /var/run/resolvconf/resolv.conf: No such file or directory

XXX@NB06 ~ $ sudo cat /var/run/resolvconf/resolv.conf
[sudo] password for XXX:
cat: /var/run/resolvconf/resolv.conf: No such file or directory

However, as Dr Hu suggested, I need to go through a couple of sequences (thanks for the link to ArchLinux, it is less complicated as expected) I just want to give some answers already:

Results from "broken internet" Toshiba NB520 (=NB07),
command lspci -k:
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)
Subsystem: Toshiba America Info Systems Device fdc0
Kernel driver in use: r8169
Kernel modules: r8169
02:00.0 Network controller: Qualcomm Atheros AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
Subsystem: Lite-On Communications Inc Device 6613
Kernel driver in use: ath9k
Kernel modules: ath9k

XXX@NB07 ~ $ iw dev wlan0 link
Connected to f0:7d:68:8e:54:44 (on wlan0)
SSID: XXXXX
freq: 2412
RX: 5218094 bytes (31726 packets)
TX: 21864 bytes (239 packets)
signal: -31 dBm
tx bitrate: 1.0 MBit/s

bss flags: short-preamble short-slot-time
dtim period: 0
beacon int: 100

So NB07 (=broken internet connection) seems to have contact to the same router (DLINK) I am currently connect with.

I will come back soon as its getting late already. Thank you both for your help...
User avatar
karlchen
Level 23
Level 23
Posts: 18238
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: ping IP name works - ping domain name does NOT work???

Post by karlchen »

Hello, GruenSpecht.

Note in advance: In order to read the file/symlink /etc/resolv.conf no root permissions are needed. The same is true for the (real) file which /etc/resolv.conf points to, /var/run/resolvconf/resolv.conf.

A short question which should require a short answer only, because I do not wish to distract you from the things which DrHu pointed you to:
Have you used the Network Manager to configure your network connections?

Because I have. And on all the systems where Network Manager has performed the configuration at minimum the file /var/run/resolvconf/resolv.conf will be present and used. It holds the DNS server configuration. I remember that at least on some machines I had to create the symlink /etc/resolv.conf myself. It is only needed for porgrammes which - hardcoded - look for the file resolv.conf in its old location.

Hm, guess I should have a peek at the ArchLinux documents as well. Though Mint is Ubuntu and not ArchLinux.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 792 days now.
Lifeline
GruenSpecht

Re: ping IP name works - ping domain name does NOT work???

Post by GruenSpecht »

Dear Karl

thanks for your immediate reply. Yes of course I did use the Network Manager. My PC Mint 13 Installation is something about one year old and I have used it a lot, only lately it broke...
Indeed did peek into ArchLinux (most things do Show runing Systems and intact Network Connections, though...?) But will either fix it or re-install.

So I declare this session closed.

Thank you DrHu, was really nice pointing me into that direction... never though this would be something for me - as not being able to distingish console from terminal :oops:
Locked

Return to “Networking”