Summary: | sys-apps/net-tools: `hostname -f` triggers IPv6 DNS query even when no IPv6 configuration is present | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | marco |
Component: | [OLD] Core system | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
marco
2014-09-02 15:39:44 UTC
you requested the domain be resolved fully, and your /etc/hosts doesn't provide an entry, so having it hit the network is to be expected. it looks like your hostname is set to "vx-macro" but your /etc/hosts only has "vx-beta" entries. `hostname -f` merely calls gethostbyname() which allows for either IPv4 or IPv6 to be returned. it could probably be made more explicit, but this code base isn't really recommended for improvements ... glibc does not respect USE=ipv6. its resolver will attempt IPv4 and IPv6 in parallel iirc. there is no support for disabling this behavior. it shouldn't be a problem if you have no IPv6 connectivity. net-tools does not respect USE=ipv6 either. it could be made to handle this USE flag, but it wouldn't prevent triggering of DNS IPv6 lookups in the current code base. it's not clear to me what the actual problem is you're having. that IPv6 lookups are sometimes triggered (and then immediately rejected) doesn't seem like a big deal. Sorry change every occurance of vx-beta with vx-marco ( cut and paste mistake from other vm) . hostname=vx-marco.intranet.test.it Ok is not a big deal or problem but why hostname -f triggers a dns query instead looks in /etc/host ? when cat /etc/host.conf order hosts, bind multi on and cat /etc/hosts 127.0.0.1 vx-marco.intranet.test.it vx-marco localhost (In reply to marco from comment #2) because you've configured your system to search dns: cat /etc/nsswitch.conf hosts: files dns and hostnames can have aliases. so when `hostname` calls gethostbyname(), it tries to find the host as well as all of its aliases, which means it finds both the entry in /etc/hosts and via dns. the fact that it uses IPv6 is due to hostname.c itself uses PF_INET6 when IPv6 support is available. i've added a USE=ipv6 flag to the latest ebuild, but otherwise, i don't see what you describe as a bug. http://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82bbf124f11397a2e97d821036300532c65c8567 Ok, thanks for the explanation and for the USE flag :) |