# Can ping but not browse/wget

## ComputerNerd

For some strange reason when using both wifi and ethernet I am able to ping some sites but not visit them. I do not understand why that is.

```

yoda@Mordor ~ $ ping -c 3 forums.gentoo.org

PING gossamer-ipvs-forums-v4v6.gentoo.org (204.187.15.12) 56(84) bytes of data.

64 bytes from forums.gentoo.org (204.187.15.12): icmp_seq=1 ttl=55 time=102 ms

64 bytes from forums.gentoo.org (204.187.15.12): icmp_seq=2 ttl=55 time=101 ms

64 bytes from forums.gentoo.org (204.187.15.12): icmp_seq=3 ttl=55 time=101 ms

--- gossamer-ipvs-forums-v4v6.gentoo.org ping statistics ---

3 packets transmitted, 3 received, 0% packet loss, time 2002ms

rtt min/avg/max/mdev = 101.113/101.750/102.179/0.528 ms

yoda@Mordor ~ $ wget forums.gentoo.org

--2013-02-28 19:54:27--  http://forums.gentoo.org/

Resolving forums.gentoo.org... failed: No address associated with hostname.

wget: unable to resolve host address 'forums.gentoo.org'

```

```

Mordor / # emerge --sync

!!! getaddrinfo failed for 'rsync6.us.gentoo.org': [Errno -5] No address associated with hostname

>>> Starting rsync with rsync://rsync6.us.gentoo.org/gentoo-portage...

>>> Checking server timestamp ...

rsync: getaddrinfo: rsync6.us.gentoo.org 873: No address associated with hostname

rsync error: error in socket IO (code 10) at clientserver.c(122) [Receiver=3.0.9]

>>> Retrying...

!!! Exhausted addresses for rsync6.us.gentoo.org

```

----------

## Hu

What is the output of ls -l /etc/resolv.conf ; cat -n /etc/resolv.conf?

----------

## ComputerNerd

 *Hu wrote:*   

> What is the output of ls -l /etc/resolv.conf ; cat -n /etc/resolv.conf?

 

```

yoda@Mordor ~ $ ls -l /etc/resolv.conf 

-rw-r--r-- 1 root root 148 Feb 28 20:53 /etc/resolv.conf

yoda@Mordor ~ $ cat -n /etc/resolv.conf

     1   # Generated by dhcpcd from wlan0

     2   # /etc/resolv.conf.head can replace this line

     3   nameserver 192.168.0.1

     4   # /etc/resolv.conf.tail can replace this line

```

----------

## lexflex

Seems to be the same problem as here:

https://forums.gentoo.org/viewtopic-t-847163-highlight-wget.html

https://forums.gentoo.org/viewtopic-t-867551-start-0.html

It appears ping uses ipv4 per default, and wget used ipv6 per default.

So, if you dont have an IPv6 internetconnection, this might not work

Suggestion is to emerge wget again using "-ipv6" ( see second link)

Alex.

----------

## ComputerNerd

Yep that was the issue the network that I am on right now does not appear to support ipv6. I do not know why I would not have thought of it.

----------

## ComputerNerd

Sorry for the double post but it appears that there is no way for portage/emerge to use ipv4 like the wget. Is the only way to disable ipv6 in the kernel  and have -ipv6 in my use flags. One Network that I use supports ipv6 and the other one does not. I do not want to recompile every other week just to switch between ipv6 and ipv4 there has to be a better way.

----------

## py-ro

You could just set FETCHCOMMAND and PORTAGE_RSYNC_EXTRA_OPTS.

More in man make.conf.

Bye

Py

----------

## ComputerNerd

Thank you it works perfectly now.

----------

## Hu

wget should automatically fall back to an IPv4 A record if no IPv6 AAAA record is available.  However, some braindead DNS resolvers become confused and refuse to provide proper service if you submit a query for an IPv6 record.

----------

