Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 436530 - sys-libs/glibc: /etc/host.conf: make "multi on" the default
Summary: sys-libs/glibc: /etc/host.conf: make "multi on" the default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-28 18:11 UTC by Eray Aslan
Modified: 2017-12-16 19:04 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eray Aslan gentoo-dev 2012-09-28 18:11:39 UTC
/etc/host.conf has:

[...]
# Valid  values are on and off.  If set to on, the resolv+ library
# will return all valid addresses for a host that appears  in  the
# /etc/hosts  file,  instead  of  only  the first.  This is off by
# default, as it may cause a substantial performance loss at sites
# with large hosts files.
#
multi off


This setting does seem like a relic from the past.  With the default multi off, getaddrinfo() returns just one address which caused a few surprises on our email server which has both ipv6 and ipv4 addresses.

I don't know about "substantial performance loss" but it does seem unlikely in this time and age.  As more and more machines are getting dual-stacked, I believe multi on makes more sense as the default.
Comment 1 SpanKY gentoo-dev 2012-09-28 20:01:55 UTC
if /etc/hosts is large, then every network look up has to scan the entire file for possible multiple matches, so yes, there will still be a performance impact.

we could probably cheat and do something in pkg_preinst like:
  if [[ $(wc -l < "${ROOT}"/etc/hosts) -lt 1000 ]] ; then
    sed -i '/^multi off/s:off:on:' "${ROOT}"/etc/hosts
    elog "Defaulting /etc/host.conf:multi to on"
  fi
Comment 2 SpanKY gentoo-dev 2012-10-02 07:12:24 UTC
should be all set now in the tree; thanks for the report!

Commit message: Default host.conf:multi to on when /etc/hosts is small
http://sources.gentoo.org/sys-libs/glibc/files/eblits/pkg_preinst.eblit?r1=1.5&r2=1.6
Comment 3 Larry the Git Cow gentoo-dev 2017-12-16 19:04:23 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e35ef2d25fd6bc46a3289f4c39667727c32e1eea

commit e35ef2d25fd6bc46a3289f4c39667727c32e1eea
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2017-12-16 19:03:53 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2017-12-16 19:04:12 +0000

    sys-libs/glibc: Downgrade hosts.conf message to einfo, bug 638154
    
    The logic of the setting makes sense though...
    
    Bug: https://bugs.gentoo.org/436530
    Closes: https://bugs.gentoo.org/638154
    Package-Manager: Portage-2.3.18, Repoman-2.3.6

 sys-libs/glibc/glibc-2.26-r3.ebuild | 2 +-
 sys-libs/glibc/glibc-9999.ebuild    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)}