Cannot access internet

Asked by Craig Wilson

I am totally new to Ubuntu and I am running 10.10 from a pen drive to see how it works. Everything was going fine. I created a USB boot drive with a 1GB persistent file, launched Ubuntu and connected to my wireless network easily and was able to access the internet wirelessly from two different laptops on the first day I tried. Then yesterday it would not connect at all, and the software center cannot find any websites to download anything.
I can ping ip addresses but I cannot ping www.ubuntu.com (unknown host). I suspect it is a DNS server issue.
I tried cat /etc/resolv.conf and it returned an input/output error.
Looking in the /etc folder, resolv.conf doesn't exist. Only resolv.conf.tmp
resolv.conf.tmp contains a couple of search terms relating to the wireless router and nameserver 192.168.1.254
My guess is that resolv.conf is not being recreated when I reboot and since that doesn't exist, DNS isn't working.

I tried to rename resolv.conf.tmp to resolv.conf in the graphical window but didn't have permissions. That is where I am very naive in Linux - I don't know how to do the simple file editing commands.

Please let me know if you think I am on the right track, and give detailed instructions on how to correct this problem.

Thanks,

Craig

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Solved by:
Craig Wilson
Solved:
Last query:
Last reply:
Revision history for this message
Craig Wilson (bigcraig-mail-ubuntu) said :
#1

I see from other threads that you usually need some additional information. Hopefully this is helpful:

ubuntu@ubuntu:~$ uname -a; lsb_release -a; echo; sudo lshw -C network
Linux ubuntu 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick

  *-network
       description: Wireless interface
       product: PRO/Wireless 4965 AG or AGN [Kedron] Network Connection
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:0c:00.0
       logical name: wlan0
       version: 61
       serial: 00:21:5c:43:d5:9f
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlagn driverversion=2.6.35-22-generic firmware=228.61.2.24 ip=192.168.1.107 latency=0 link=yes multicast=yes wireless=IEEE 802.11abg
       resources: irq:45 memory:f1ffe000-f1ffffff
  *-network
       description: Ethernet interface
       product: NetXtreme BCM5756ME Gigabit Ethernet PCI Express
       vendor: Broadcom Corporation
       physical id: 0
       bus info: pci@0000:09:00.0
       logical name: eth2
       version: 00
       serial: 00:21:70:9c:d9:ba
       capacity: 1GB/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm vpd msi pciexpress bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=tg3 driverversion=3.110 firmware=5756m-v3.09 latency=0 link=no multicast=yes port=twisted pair
       resources: irq:47 memory:f1bf0000-f1bfffff

ubuntu@ubuntu:~$ iwconfig
lo no wireless extensions.

eth2 no wireless extensions.

wlan0 IEEE 802.11abg ESSID:"2WIRE434"
          Mode:Managed Frequency:2.412 GHz Access Point: 00:25:3C:5E:25:B9
          Bit Rate=1 Mb/s Tx-Power=15 dBm
          Retry long limit:7 RTS thr:off Fragment thr:off
          Power Management:off
          Link Quality=69/70 Signal level=-41 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

ubuntu@ubuntu:~$ ifconfig
eth2 Link encap:Ethernet HWaddr 00:21:70:9c:d9:ba
          UP BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
          Interrupt:17

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:184 errors:0 dropped:0 overruns:0 frame:0
          TX packets:184 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:13920 (13.9 KB) TX bytes:13920 (13.9 KB)

wlan0 Link encap:Ethernet HWaddr 00:21:5c:43:d5:9f
          inet addr:192.168.1.107 Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::221:5cff:fe43:d59f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:216 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:32175 (32.1 KB) TX bytes:7885 (7.8 KB)

Revision history for this message
Ubfan (ubfan1) said :
#2

I think you are right about the DNS not working. Right click on the network-manager icon (the pie shaped pile of arcs in the toolbar) and select edit connections. Select wireless, then select your access point and edit it. Click on the ipv4 tab, and see if you have selected the DHCP selection, NOT the "DHCP addresses only" tab. Change it to DHCP, and maybe you are all set.

Revision history for this message
Craig Wilson (bigcraig-mail-ubuntu) said :
#3

Hi Ubfan,
Thanks for the suggestion. I checked but the ipv4 tab was already set to Automatic (DHCP). Must be something else.

Revision history for this message
Ubfan (ubfan1) said :
#4

Well, you could go to the addresses only DHCP and use 8.8.8.8 for the DNS server to see if that works. Will probably be slower than your isp connection.

Revision history for this message
Craig Wilson (bigcraig-mail-ubuntu) said :
#5

Ubfan,
I've added 8.8.8.8 and tried some testing suggestions from http://code.google.com/speed/public-dns/docs/using.html

I successfully added the Google DNS servers in Network Connections, and the /etc/resolv.conf.tmp file has been updated to include these nameservers:
# Generated by NetworkManager
domain gateway.2wire.net
search gateway.2wire.net
nameserver 192.168.1.254
nameserver 8.8.8.8
nameserver 8.8.4.4

dig @8.8.8.8 google.com works. So does dig @192.168.1.254 google.com, so does nslookup google.com 4.2.2.1
So there is no problem connecting to DNS servers from the command line.

In Firefox www.google.com still doesn't work. www.18.62.0.96/ does find the MIT page.
So Firefox is not connecting to any DNS server to allow it to resolve a hostname. But it can find an ip address......

I tried to manually create /etc/resolv.conf
"sudo cp /etc/resolv.conf.tmp /etc/resolv.conf.auto" works but
"sudo cp /etc/resolv.conf.tmp /etc/resolv.conf" does not (input/output error) I don't understand the permissions enough to know why.

Revision history for this message
Craig Wilson (bigcraig-mail-ubuntu) said :
#6

Regarding file permissions and the /etc/resolv.conf input/ouput errors:

ubuntu@ubuntu:~$ ls -al /etc | grep resol
ls: cannot access /etc/resolv.conf: Input/output error
drwxr-xr-x 3 root root 36 2010-10-07 09:03 resolvconf
-????????? ? ? ? ? ? resolv.conf
-rw-r--r-- 1 root root 93 2011-03-02 03:00 resolv.conf.auto
-rw-r--r-- 1 root root 93 2011-03-02 04:36 resolv.conf.tmp
-rw-r--r-- 1 root root 12288 2011-03-02 00:57 .resolv.conf.tmp.swp

Revision history for this message
Ubfan (ubfan1) said :
#7

I think you need to remove the 192... nameserver from resolv.conf
But since that is a generated file, look at the connection (R click network-manger)/edit connections/
select your connection, and edit. See if there is a manual set of nameservers given -- remove the 192 if present.
Maybe just gksudo gedit resolv.conf and delete the line to see if that makes any difference.,

Revision history for this message
Craig Wilson (bigcraig-mail-ubuntu) said :
#8

Since I had only been using Ubuntu for a day or two I decided to reinstall it on the USB drive. Immediately after installation, /etc/resolv.conf did not exist. Once I conneced to my wireless router /etc/resolv.conf was created as follows:
# Generated by NetworkManager
domain gateway.2wire.net
search gateway.2wire.net
nameserver 192.168.1.254

And everything is working fine. Hopefully it doesn't go wrong again.

So it looks like /etc/resolv.conf was the problem all along. The file must have been corrupt or something as it seemed to exist, but was impossible to view, edit or delete.

Thanks Ubfan for your input!

Craig