# DNS problems

## cld71

Don't know when this started, but lately I have been experiencing DNS resolve problems.

When the computer boots up it is find, but that only lasts for about 5 - 10 min., then when a program like Firefox tries to resolve a DNS it false.

I know it isn't my ISP, because I have other computers using Winblows 7/XP working find.

When the computer stops resolving DNS I restart the network service, and the system is find for about 5 - 10 min., then I have to restart the network service again.

Here is my gentoo --info

```
Portage 2.1.7.17 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11-r1, 2.6.32-gentoo-r6 i686)

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

System uname: Linux-2.6.32-gentoo-r6-i686-Intel-R-_Pentium-R-_4_CPU_2.40GHz-with-gentoo-2.0.1

Timestamp of tree: Sun, 21 Feb 2010 01:45:02 +0000

distcc 3.1 i686-pc-linux-gnu [disabled]

ccache version 2.4 [disabled]

app-shells/bash:     4.1_p2

dev-java/java-config: 2.1.10

dev-lang/python:     2.5.4-r3, 2.6.4-r1, 3.1.1-r1

dev-util/ccache:     2.4-r8

dev-util/cmake:      2.8.0-r2

sys-apps/baselayout: 2.0.1

sys-apps/openrc:     0.6.0-r1

sys-apps/sandbox:    2.2

sys-devel/autoconf:  2.13, 2.65

sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1

sys-devel/binutils:  2.20

sys-devel/gcc:       4.3.4, 4.4.3

sys-devel/gcc-config: 1.4.1

sys-devel/libtool:   2.2.6b

virtual/os-headers:  2.6.32

ACCEPT_KEYWORDS="x86 ~x86"

ACCEPT_LICENSE="*"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -pipe"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"

CXXFLAGS="-O2 -march=pentium4 -mmmx -msse -msse2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"

GENTOO_MIRRORS="http://gentoo.osuosl.org/"

LANG="C"

LDFLAGS="-Wl,-O1"

LINGUAS="en"

MAKEOPTS="-j1"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

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

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

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

USE="32bit X a52 aac acl acpi alsa apache2 apic bash-completion berkdb bluetooth branding bts bzip2 cairo cdda cddax cdio cdr cid clflush cli cmov consolekit cracklib crypt cups cx8 cxx dbus dc1394 de derby dirac directfb dns dri dts dv dvb dvd dvdr eds emboss encode evo extras fam fbcon festival firefox firefox3 flac fluidsynth fortran fpu freetts fxsr gcj gdbm gdm gif gimp gkrellm gmplayer gnome gnutls gpm groovy gstreamer gtk h323 hal ht httpd iconv ieee1394 imap ipv6 jai java java6 javamail jce jmf joystick jpeg jpeg2k jsapi jsch kino ldap libnotify libv4l2 live mad maps mbrola mca mce mikmod mmx mng modplug modules mp3 mp4 mpeg mplayer msr mtp mtrr mudflap musepack mysql nautilus ncurses netbeans networkmanager nls nntp nptl nptlonly nsplugin ogg openal opengl openmp pae pam pat pbe pcre pda pdf pebs perl pge png policykit postgis postgres ppds pppd pse pse36 pvr python qt3support qt4 quicktime readline reflection remoteosd rtsp samba schroedinger sdl sdl-image secure-delete sep server servletapi session shine shout sip smartcard sndfile spamassassin speech speex spell spl ss sse sse2 ssh ssl startup-notification stream svg svga symlink sync_rdtsc sysfs tcpd theora thunar tiff tm truetype tsc twolame udev unicode upnp usb v4l v4l2 vboxwebsrv vcdinfo vcdx virtualbox vme vnc vorbis wav webdav webdav-neon webdav-serf win32codecs wma wma-fixed x11vnc x264 x86 xcb xine xinerama xml xorg xrandr xtpr xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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="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 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" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse joystick synaptics vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" NETBEANS_MODULES="apisupport harness ide java nb websvccommon cnd dlight enterprise ergonomics groovy identity mobility php profiler ruby webcommon" RUBY_TARGETS="jruby" USERLAND="GNU" VIDEO_CARDS="nv vga radeon vesa nvidia v4l virtualbox" 

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

Here is an example of my /etc/conf.d/net file:

```

config_eth1=( "192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255 " )

routes_eth1=( "default gw 192.168.1.1" )

dns_servers_eth1=( "XXX.XXX.XXX.1 XXX.XXX.XXX.2 XXX.XXX.XXX.3 192.168.1.1" )

```

Thanks.

----------

## Hu

When it fails, what is the output of nl /etc/resolv.conf ; gawk '/^nameserver / { print $2; }' < /etc/resolv.conf | xargs -n1 -I_ dig @_ www.google.com?

----------

## cld71

/etc/resolv.conf doesn't change.

/etc/resolv.conf looks like this:

```
nameserver XXX.XXX.XXX.1

nameserver XXX.XXX.XXX.2

nameserver XXX.XXX.XXX.3

nameserver 192.168.1.1
```

Before, and after this happens.

I am also using ifconfig module to do ip addressing.

Should I think about changing to iproute2?

----------

## darkphader

Would simplify it to:

```
modules="iproute2"

config_eth1="192.168.1.2/24"

routes_eth1="default via 192.168.1.1"
```

Of course, iproute2 is only a personal preference - install it first if you decide to use it. There's no need for the dns_servers... line as you're using a static config so just edit resolv.conf directly with the proper information.

In your route line you do have "default gw 192.168.1.1" instead of "default via 192.168.1.1".

And what happened to eth0?

Edited to show proper format for OpenRC (isn't everyone using this now?). Odd that the handbook shows the old style.

----------

## cyrillic

I would test each of your 4 DNS servers individually.

Just put 1 at a time in your resolv.conf, and then see how long it takes to fail.

You may find one that is slow and/or defective that is screwing things up for the rest of the servers.

----------

