cbuggs
Posts: 4
Joined: Thu Feb 23, 2017 5:46 pm

Need Help, Internet works with IP only (resolved)

Thu Feb 23, 2017 5:55 pm

Hello,

I am fairly new to the Raspberry Pi, but have Linux and coding experience.

I downloaded and installed the latest Raspbian PIXEL image from this website, but upon installation I could not get online unless I directly typed in an IP address.

I've tried making adjustments to various files, /etc/network/interfaces didn't fix the issue. Editing /etc/resolv.conf doesn't work as it gets overwritten. I've tried an ethernet cable as well as a wifi connection, but still no luck.

I'm hoping someone could offer some help. Why doesn't the OS work online out of the box?

Thanks
Last edited by cbuggs on Fri Feb 24, 2017 5:14 pm, edited 2 times in total.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Need Help, Internet works with IP only

Thu Feb 23, 2017 8:12 pm

Get the results from the following commands (LXTerminal window)

ip addr
ip route
sudo ping -c3 $(ip route | awk '/default/ {print $3}')
sudo ping -c3 8.8.8.8
sudo ping -c3 google.com
cat /etc/resolv.conf
for i in $(awk '/nameserver/ {print $2}' /etc/resolv.conf); do ping -c3 $i; done
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

cbuggs
Posts: 4
Joined: Thu Feb 23, 2017 5:46 pm

Re: Need Help, Internet works with IP only

Thu Feb 23, 2017 9:29 pm

I reinstalled the Raspbian OS and setup all of the localization options before joining a wifi network. Still no luck, only typing an ip address works. Here are the results of the commands you listed.

pi@raspberrypi:~ $ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:32:95:22 brd ff:ff:ff:ff:ff:ff
inet6 fe80::6761:477d:e402:808d/64 scope link tentative
valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:27:eb:67:c0:77 brd ff:ff:ff:ff:ff:ff
inet 10.10.32.37/23 brd 10.10.33.255 scope global wlan0
valid_lft forever preferred_lft forever
inet6 fe80::371b:47fb:8c8:87d4/64 scope link
valid_lft forever preferred_lft forever

pi@raspberrypi:~ $ ip route
default via 10.10.32.1 dev wlan0 metric 303
10.10.32.0/23 dev wlan0 proto kernel scope link src 10.10.32.37 metric 303

pi@raspberrypi:~ $ sudo ping -c3 $(ip route | awk '/default/ {print $3}')
PING 10.10.32.1 (10.10.32.1) 56(84) bytes of data.
64 bytes from 10.10.32.1: icmp_seq=1 ttl=255 time=5.12 ms
64 bytes from 10.10.32.1: icmp_seq=2 ttl=255 time=4.85 ms
64 bytes from 10.10.32.1: icmp_seq=3 ttl=255 time=5.43 ms

--- 10.10.32.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 4.856/5.140/5.439/0.245 ms

pi@raspberrypi:~ $ sudo ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=47 time=26.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=47 time=25.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=47 time=26.1 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 25.421/25.874/26.104/0.370 ms

pi@raspberrypi:~ $ sudo ping -c3 google.com
ping: unknown host google.com

pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain wcbvi.k12.wi.us
nameserver 127.0.0.1

pi@raspberrypi:~ $ for i in $(awk '/nameserver/ {print $2}' /etc/resolv.conf); do ping -c3 $i; done
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.146 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.114 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.105 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.105/0.121/0.146/0.021 ms

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Need Help, Internet works with IP only

Thu Feb 23, 2017 9:44 pm

cbuggs wrote: pi@raspberrypi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain wcbvi.k12.wi.us
nameserver 127.0.0.1
There's your problem, there's no name server running on your Raspberry, but your Router is sending that as the default nameserver.

sudo rm /etc/resolv.conf
sudo sh -c "echo 'domain wcbvi.k12.wi.us' > /etc/resolv.conf"
sudo sh -c "echo 'nameserver 10.10.32.1' >> /etc/resolv.conf"
sudo sh -c "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf"

is an ugly hack but it will fix your problem.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

cbuggs
Posts: 4
Joined: Thu Feb 23, 2017 5:46 pm

Re: Need Help, Internet works with IP only

Thu Feb 23, 2017 10:19 pm

Thank you. Unfortunately resolv.conf somehow gets overwritten upon reboot, so not a permanent solution.

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Need Help, Internet works with IP only

Fri Feb 24, 2017 3:41 pm

cbuggs wrote:Thank you. Unfortunately resolv.conf somehow gets overwritten upon reboot, so not a permanent solution.
The permanent solution is to contact IT support for the domain wcbvi.k12.wi.us and explain that there is a problem with the DHCP server on 10.10.32.1 is not sending a correct DNS server address.

Edit: Please make sure that you are allowed to connect a Pi to the network, see page 108
http://wcbvi.k12.wi.us/sites/wcbvi/publ ... 6-2017.pdf
The road to insanity is paved with static ip addresses

cbuggs
Posts: 4
Joined: Thu Feb 23, 2017 5:46 pm

Re: Need Help, Internet works with IP only

Fri Feb 24, 2017 5:12 pm

Thank you. I actually work here in IT and was trying to see if I could get a screen reader working on the Pi so our blind students could use it for projects.

Ernst
Posts: 1334
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Need Help, Internet works with IP only (resolved)

Fri Feb 24, 2017 5:55 pm

I did some research and I found a solution to your problem.

Code: Select all

sudo echo static domain_name=wcbvi.k12.wi.us >> /etc/dhcpcd.conf
sudo echo static domain_name_servers=8.8.4.4 8.8.8.8 >> /etc/dhcpcd.conf
this will place the information in /etc/resolv.conf every time the interfaces are brought up.
I have tested this using raspbian 4.4.38-v7+
(source: https://wiki.archlinux.org/index.php/Resolv.conf)
The road to insanity is paved with static ip addresses

Return to “Raspberry Pi OS”