Wietse wrote:

> If you have ""hosts: files dns", and you have only one address in
> /etc/hosts, you'll get only one address from getaddrinfo().
As I wrote before, /etc/hosts contains both addresses:

176.9.43.216 monthu.horus-it.com monthu
2a01:4f8:150:54c1::b009:2bd8 monthu.horus-it.com monthu

> To support multiple IP addresses per name in /etc/hosts, specify
> "multi on" in /etc/host.conf.

The Gentoo Linux default is "multi off". When I switch to "multi on",
the correct answer is returned even with "hosts: files dns".

./getaddrinfo monthu.horus-it.com
Hostname:       monthu.horus-it.com
Addresses:      2a01:4f8:150:54c1::b009:2bd8 176.9.43.216

> Given that we're in the early 21st century where a host can have
> both IPv4 and IPv6, I think that "multi on" should be the default.

I agree. Gentoo documentation states that "This is off by default, as
it may cause a substantial performance loss at sites with large hosts
files.", but large host files are no longer en vogue.

Well, "multi on" did the trick, so thanks for your support!

-Ralph

Reply via email to