![]() And it would become application-specific and thus would have to be applied to one program at a time. Such a shuffle would need to take IP versions and more into account. But perhaps worse is, since getaddrinfo() is now made to return the addresses in a sort of order of preference it is hard to “glue on” a layer on top that simple shuffles the returned results. Since gai.conf needs local edits to provide a different function response it is not an answer. Since getaddrinfo() now has worked like this for almost a decade, we can forget about “fixing” it. ![]() The impact on a large amount of common utilities is simply that when they go IPv6-enabled, they also at the same time go round-robin-DNS disabled. Others have noticed this flaw as well and some have fought compassionately arguing that this is a bad thing, while of course there’s an opposite side with people claiming it is the right behavior and that doing round robin DNS like this was a bad idea to start with anyway. The order seems to be dictated mostly by the above mentioned RFCs and the local /etc/gai.conf file, but neither is helpful if getting decent round robin is your aim. I noticed this back in 2005 and posted a question on the glibc hackers mailinglist: As you can see, my question was delightfully ignored and nobody ever responded. Now getaddrinfo() returns basically the same order in every invoke. ![]() With the new ideas of how to return addresses this load balancing way no longer works. So, back to the good old way to do round robin DNS: multiple addresses (be it IPv4 or IPv6 or both). Suddenly applications would iterate over both IPv4 and IPv6 addresses and do it in an order that would be clever from an IPv6 upgrade-path perspective. It would then become a list of hosts in “preferred” order. In 2003 the IETF guys had shipped RFC 3484 detailing Default Address Selection for Internet Protocol version 6, and using that as guideline most (all?) implementations were now changed to return the list of addresses in that order. Like in which order these functions return addresses. So the (good parts of the) world replaced all calls to gethostbyname() with calls to getaddrinfo() and everything now supported IPv6 and things were all dandy and fine? Not exactly. It is the shiny thing the world needed! not a drop-in replacement This is the modern function that supports IPv6 and more. Enter getaddrinfo() also POSIX (and defined in RFC 3943 and again updated in RFC 5014). It had to be replaced by something better. The mere whisper of IPv6 makes it break down and cry. If an application just iterates over the list and connects to them in the order as received, the round robin concept works perfectly well. That list of addresses will be in a seemingly random order. ![]() When calling gethostbyname() on a given round robin host name, the function returns an array of addresses. This is a POSIX and single unix specification that’s been around since basically forever. If you’re an old-school hacker, if you learned to do socket and TCP/IP programming from the original Stevens’ books and if you were brought up on BSD unix you learned that you resolve host names with gethostbyname() and friends. It is also used by high profile web servers, like for example and host name resolving By setting up an A entry in a DNS zone to resolve to multiple IP addresses, clients would get different results in a semi-random manner and thus hitting different servers at different times: server IN A 192.168.0.1įor example, if you’re a small open source project it makes a perfect way to feature a distributed service that appears with a single name but is hosted by multiple distributed independent servers across the Internet. Round robin DNS has been the way since a long time back to get some rough and cheap load-balancing and spreading out visitors over multiple hosts when they try to use a single host/service with static content. I’ll dance around the subject first a bit by providing the full background info… round robin basics This is only facts that seem to still be unknown to many people so I just want to help out documenting this to help educate the world. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |