Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 235963

Summary: /etc/hosts is not read ignoring nsswitch.conf
Product: Gentoo Linux Reporter: Michele Schiavo <micheleschi>
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED INVALID    
Severity: major    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: strace host unouno

Description Michele Schiavo 2008-08-27 22:47:20 UTC
/etc/hosts file is not read ignoring /etc/nsswitch.conf



Reproducible: Always

Actual Results:  
/etc/hosts is ignored

Expected Results:  
/etc/hosts will be read

cat /etc/nsswitch.conf | grep host
hosts:		files dns


speriment log # cat /etc/hosts
....
127.0.0.1	localhost
111.111.111.111 unouno









emerge --info
Portage 2.1.4.4 (default/linux/amd64/2008.0/desktop, gcc-4.3.1, glibc-2.7-r2, 2.6.25-gentoo-r7 x86_64)
=================================================================
System uname: 2.6.25-gentoo-r7 x86_64 Intel(R) Core(TM)2 Quad CPU Q9300 @ 2.50GHz
Timestamp of tree: Wed, 27 Aug 2008 17:45:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r6
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -mtune=core2 -march=core2 -pipe -fomit-frame-pointer -msse4.1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /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/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -mtune=core2 -march=core2 -pipe -fomit-frame-pointer -msse4.1"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg_ collision-protect_ distcc distlocks maketest metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp.twaren.net/Linux/Gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://mirror.switch.ch/ftp/mirror/gentoo/"
LDFLAGS="-Wl,-O1"
LINGUAS="it it_IT en en_US en_GB es es_ES"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
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"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="16bit 64bit X X509 a52 aac aalib acpi aiglx aim alsa amd64 amr amrnb amrwb apache2 apm applet audiofile avi bacula-console bash-completion berkdb bidi bitmap-fonts bittorrent bluetooth bonobo branding browserplugin bzip2 cairo caps cdda cddb cdio cdparanoia cdr cgi chroot cli cracklib crypt css ctype cups curl dbus dc1394 deskbar divx dlloader dri dts dv dvb dvd dvdr dvdread dvi dynamic eds em emboss emovix enca encode esd ethereal evo evolution exif expat faillog fam fame fbsplash ffmpeg firefox flac flash fontconfig foomaticdb fortran fping freetds freetype ftp gaim gcc4 gd gdbm gdm gedit gencertdaily geoip gif gimp gimpprint glitz glut gmail gmedia gmp gno gnome gnome-keyring gnutls gphoto2 gpm gsf gsm gstreamer gtk gtk2 gtkhtml guile hal hash hddtemp howl iconv id3tag idea idn ieee1394 imagemagick imap imlib ipod isdnlog ithreads java jpeg kerberos lame lcms libcaca libclamav libedit libnotify libwww live lm_sensors logrotate logwatch lzo lzw lzw-tiff mad maildir maildrop matroska md5sum mhash midi mikmod mime ming mjpeg mmx mmxext mng mono motif mozilla mozsvg mp2 mp3 mpeg mpm-prefork msn mudflap multilib musepack musicbrainz mysql nautilus ncurses nemesei network networking new-login nfs ng nls nptl nptlonly nsplugin nvidia obex offensive ogg oggvorbis openal opengl openmp opensslcrypt optimisememory pam pcre pda pdf pdflib perl php pidgin png pnm pop posix ppds pppd prediction python qmail qt3support qt4 quicktime quotas radio readline realmedia recode reflection regex remote rtc samba scanner sdl sensord server session simplexml skins slang smp sms sndfile sound sox spamassassin speex spell spl sqlite srt sse sse2 ssl ssse2 ssse3 startup-notification stream subtitles svg symlink sysfs syslog tcltk tcpd teletext tetex theora threads threadsafe tiff tivo toolbar tracker truetype truetype-fonts twolame type1-fonts udev unicode upnp usb v4l v4l2 vcd vhosts vim-syntax vlm vorbis wavpack wifi wmf wmp wxgtk1 wxwindows x264 xanim xcomposite xml xml2 xmlreader xmlwriter xorg xpm xscreensaver xv xvid xvmc zip zlib" ALSA_CARDS="intel8x0 usb-audio" 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 auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" CAMERAS="spca50x" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LINGUAS="it it_IT en en_US en_GB es es_ES" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Michele Schiavo 2008-08-27 22:48:52 UTC
Created attachment 163944 [details]
strace host unouno
Comment 2 Michele Schiavo 2008-08-27 22:49:49 UTC
host unouno
Host unouno not found: 3(NXDOMAIN)
Comment 3 Wormo (RETIRED) gentoo-dev 2008-08-28 00:12:35 UTC
Try this:

$ ping unouno
PING unouno (111.111.111.111) 56(84) bytes of data.

Tools like 'host' and 'dig' happen to be dns utilities -- only interested in dns queries, not doing the normal name resolution procedure.

I've been bitten by this one before, it sure seems like something is wrong...