# dns problem

## bazli

Hi guys! I'm new so thanks in advance for your help.

I can't seem to ping www.gentoo.org. So I can't emerge anything.

I can ping other sites like google or yahoo fine.

Any ideas?

Thanks!

----------

## PaulBredbury

ping is not a good test, it's often blocked by firewalls.

I think MTU is a common thing to get wrong. But you'll have to provide more info.

----------

## bazli

What should my MTU setting be? sometimes i am able to ping gentoo but i'm still not able to emerge anything. links also doesn't work.

Extra information:

Home router + Gentoo doesn't work

Home router + Ubuntu is ok

Home router + windows is ok

Phone tethering hotspot + Gentoo is ok (managed to ping and emerge)

Phone tethering hotspot + Ubuntu is ok

Phone tethering hotspot + Windows is ok

```

bazli@buzzgentoo ~ $ ping www.google.com

PING www.google.com (74.125.135.147) 56(84) bytes of data.

64 bytes from ni-in-f147.1e100.net (74.125.135.147): icmp_req=1 ttl=54 time=12.9 ms

64 bytes from ni-in-f147.1e100.net (74.125.135.147): icmp_req=2 ttl=54 time=10.3 ms

64 bytes from ni-in-f147.1e100.net (74.125.135.147): icmp_req=3 ttl=54 time=12.5 ms

^C

--- www.google.com ping statistics ---

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

rtt min/avg/max/mdev = 10.343/11.964/12.965/1.156 ms

bazli@buzzgentoo ~ $ ping www.gentoo.org

PING www-bytemark-v4v6.gentoo.org (89.16.167.134) 56(84) bytes of data.

64 bytes from www.gentoo.org (89.16.167.134): icmp_req=1 ttl=54 time=291 ms

64 bytes from www.gentoo.org (89.16.167.134): icmp_req=2 ttl=54 time=290 ms

64 bytes from www.gentoo.org (89.16.167.134): icmp_req=3 ttl=54 time=290 ms

^C

--- www-bytemark-v4v6.gentoo.org ping statistics ---

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

rtt min/avg/max/mdev = 290.152/290.909/291.968/0.771 ms

bazli@buzzgentoo ~ $ cat /etc/resolv.conf 

# Generated by dhcpcd from eth0

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

nameserver 8.8.8.8

nameserver 8.8.4.4

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

bazli@buzzgentoo ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

modules="dhcpcd"

config_eth0="dhcp"

dhcp_eth0="nodns"

dns_servers_eth0=(

"8.8.8.8"

)

#dns_servers_eth0="8.8.8.8"

bazli@buzzgentoo ~ $ ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255

        inet6 fe80::a00:27ff:fece:ccb6  prefixlen 64  scopeid 0x20<link>

        ether 08:00:27:ce:cc:b6  txqueuelen 1000  (Ethernet)

        RX packets 25  bytes 2775 (2.7 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 293  bytes 21956 (21.4 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 0  (Local Loopback)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=193<UP,RUNNING,NOARP>  mtu 1480

        inet6 ::127.0.0.1  prefixlen 96  scopeid 0x90<compat,host>

        sit  txqueuelen 0  (IPv6-in-IPv4)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 18  dropped 0 overruns 0  carrier 0  collisions 0

```

Do let me know what other information you require. Thanks!!

----------

## NeddySeagoon

bazli,

In the not working configuration, please post the following:-

The content of /etc/conf.d/net

The content of /etc/resolv.conf

The output of ifconfig

The output of route

----------

## bazli

Hi Neddy, information below:

Thanks!

```

bazli@buzzgentoo ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

modules="dhcpcd"

config_eth0="dhcp"

dhcp_eth0="nodns"

dns_servers_eth0=(

"8.8.8.8"

)

mtu_eth0="1492"

#dns_servers_eth0="8.8.8.8"

bazli@buzzgentoo ~ $ cat /etc/resolv.conf 

# Generated by dhcpcd from eth0

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

nameserver 8.8.8.8                                                              

nameserver 8.8.4.4                                                              

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

bazli@buzzgentoo ~ $ ifconfig                                                   

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1492                      

        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255             

        inet6 fe80::a00:27ff:fece:ccb6  prefixlen 64  scopeid 0x20<link>        

        ether 08:00:27:ce:cc:b6  txqueuelen 1000  (Ethernet)                    

        RX packets 18  bytes 2885 (2.8 KiB)                                     

        RX errors 0  dropped 0  overruns 0  frame 0                             

        TX packets 68  bytes 5511 (5.3 KiB)                                     

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0              

                                                                                

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436                                    

        inet 127.0.0.1  netmask 255.0.0.0                                       

        inet6 ::1  prefixlen 128  scopeid 0x10<host>                            

        loop  txqueuelen 0  (Local Loopback)                                    

        RX packets 0  bytes 0 (0.0 B)                                           

        RX errors 0  dropped 0  overruns 0  frame 0                             

        TX packets 0  bytes 0 (0.0 B)                                           

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=193<UP,RUNNING,NOARP>  mtu 1480

        inet6 ::127.0.0.1  prefixlen 96  scopeid 0x90<compat,host>

        sit  txqueuelen 0  (IPv6-in-IPv4)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 8  dropped 0 overruns 0  carrier 0  collisions 0

bazli@buzzgentoo ~ $ route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

default         10.0.2.2        0.0.0.0         UG    202    0        0 eth0

10.0.2.0        *               255.255.255.0   U     202    0        0 eth0

loopback        buzzgentoo.loca 255.0.0.0       UG    0      0        0 lo

bazli@buzzgentoo ~ $ 

```

----------

## NeddySeagoon

bazli,

That all looks sane.

Can you browse to http://89.16.167.134  ?

What about www.gentoo.org ?

emerge --sync depends on the rsync protocol which runs on port 873.  Is that blocked by your firewall.

Tarball fetches can use rsync, ftp, http are all of these ports open in your firewall.

Lastly, please post the output of

```
emerge --info
```

----------

## bazli

Hi Neddy,

I can browse to http://89.16.167.134/ ("Empty page!" right?) but not www.gentoo.org

Firewall settings look ok.

and my emerge --info

```

bazli@buzzgentoo ~ $ emerge --info

Portage 2.1.11.31 (default/linux/amd64/13.0/desktop/kde, gcc-4.5.4, glibc-2.15-r3, 3.6.11-gentoo x86_64)

=================================================================

System uname: Linux-3.6.11-gentoo-x86_64-Intel-R-_Core-TM-_i7-2720QM_CPU_@_2.20GHz-with-gentoo-2.1

Timestamp of tree: Thu, 24 Jan 2013 00:45:01 +0000

ld GNU ld (GNU Binutils) 2.22

app-shells/bash:          4.2_p37

dev-lang/python:          2.7.3-r2, 3.2.3

dev-util/cmake:           2.8.9

dev-util/pkgconfig:       0.27.1

sys-apps/baselayout:      2.1-r1

sys-apps/openrc:          0.11.8

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13, 2.69

sys-devel/automake:       1.9.6-r3, 1.11.6

sys-devel/binutils:       2.22-r1

sys-devel/gcc:            4.5.4, 4.6.3

sys-devel/gcc-config:     1.7.3

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r4

sys-kernel/linux-headers: 3.6 (virtual/os-headers)

sys-libs/glibc:           2.15-r3

Repositories: gentoo

ACCEPT_KEYWORDS="amd64"

ACCEPT_LICENSE="* -@EULA"

CBUILD="x86_64-pc-linux-gnu"

CFLAGS="-march=core2 -O2 -pipe"

CHOST="x86_64-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=core2 -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FCFLAGS="-O2 -pipe"

FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS="-O2 -pipe"

GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo/"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY=""

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="X a52 aac acl acpi alsa amd64 berkdb bindist bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk iconv ipv6 jpeg kde kipi lcms ldap libnotify mad mmx mng modules mp3 mp4 mpeg mudflap multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

```

----------

## NeddySeagoon

bazli,

Both the IP and gentoo.org should take you to the same place.

Your SYNC="rsync://rsync.gentoo.org/gentoo-portage"  looks ok, thats a round robin handoff.

```
GENTOO_MIRRORS="http://ftp.jaist.ac.jp/pub/Linux/Gentoo/" 
```

is a bit questionable.

You have a single server there, if its down, you can't fetch distfiles.

Run mirrorselect, audition the servers and have it choose the five fastest for you.

What shows in your firewall log when you try to browse gentoo.org ?

----------

## bazli

When I try to browse www.gentoo.org it shows me the following message:

 *Quote:*   

> The requested operation could not be completed
> 
> Unknown Host
> 
> Details of the Request:
> ...

 

Hmm my router doesn't have any firewall log.. or am i looking in the wrong place?

----------

## NeddySeagoon

bazli,

Your firewall, if you have on is implemented on your PC with iptables.

Routers may have firewalls but they are very basic and almost worthless as they are almost never updated.

```
emerge traceroute
```

 and see were it goes wrong.

Run 

```
emerge traceroute -fpv
```

fetch the files listed an put them into /usr/portage/distfiles

Now 

```
emerge traceroute
```

 will run, as you have the files.

You may also want tcpdump.  The same two part process works.

Why do you want to use 8.8.8.8 as your DNS?

Your router probably provides a caching DNS which will be faster,

What happens if you add 

```
nameserver 10.0.2.2
```

to the top of your /etc/resolv.conf  ?

Your ISP namesrvers should be tested too - unless you know they are broken.

----------

## bazli

Hi I managed to get output from tcpdump but nothing from traceroute. Any idea about the bad udp cksum?

My ISP's DNS always has problems. It works well when I set it to 8.8.8.8 in my router.

When I add 10.0.2.2, nothing happens. 

 *Quote:*   

> 
> 
> buzzgentoo bazli # tcpdump -vv
> 
> tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> ...

 

----------

## NeddySeagoon

bazli,

UDP is not a robust protocol.  When you get transmission errors, its up to the application to sort out the mess.

TCP would do a retries until it worked or timed out. This is bad for latency. So you use UDP for VoIP, not TCP.

If the errors are real, you may have a hardware problem but then they would be operating system independent.

Its possible its a packet fragmentation issue and you need to play with your MTU.

Raw ethernet should work with an MTU of 1500

PPPoE needs 1492 or less, due to the extra header.

A sensible end to end MTU should be set automatically but you may force it if you wish.

For testing try 500 that will avoid fragmentation anywhere. Don't leave it like that.  If its better/works is indicates another problem.

----------

## bazli

Hi Neddy,

When I change the MTU, there doesn't seem to be any effect.

But I found a clue.

wget always cannot resolve but if i use wget -4 it works.

Is it related to IPv4, v6?

Any idea?

Thanks!

----------

## NeddySeagoon

bazli,

Maybe.

----------

## bazli

Just to update..

I managed to emerge by using wget -4 and can now browse using firefox and setting network.dns.disableIPv6 = true. can't use Konqueror cos I don't know how to disable ipv6 in it.

Not sure if that's the correct way to do it but it's working for now.

Is there any way to disable IPv6 for all the programs?

----------

