Re: How does the Host command query DNS?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Once upon a time, Robert Moskowitz <rgm@xxxxxxxxxxxxxxx> said:
> I have noticed that the Host command is always returning first IPv4
> addresses, and then IPv6 addresses.  So I asked on the BIND list can
> got the following:

You asked the BIND list a different question than you are asking here.
BIND returns the record type requested, in random order when there is
more than one (e.g. multiple A records).  To get multiple types, you
have to send multiple queries (ANY is special).  The "host" command-line
tool does not duplicate the way an application does lookups.  "host"
(per the man page) specifically by default looks up A, AAAA, and MX, in
that order.

Applications on the other hand use a few different library calls to
convert names to addresses, most commonly gethostbyname() (old,
IPv4-only) or getaddrinfo() (new, can handle multiple address families).
For modern applications that use getaddrinfo(), the default is to follow
the ordering rules defined in RFC 3484 that (in general) put IPv6
addresses ahead of IPv4 addresses.

You can control some of the ordering with /etc/gai.conf; see "man
gai.conf" for more info.

-- 
Chris Adams <linux@xxxxxxxxxxx>
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux