mailing list archives
Re: dns and software, was Re: Reliable Cloud host ?
From: Mark Andrews <marka () isc org>
Date: Tue, 28 Feb 2012 12:47:43 +1100
In message <CAP-guGVA4eHv0K=U=x2B-WPYDy2RQ7ZE1Di2AHc+dmA_huyGzA () mail gmail com>,
William Herrin writes:
On Mon, Feb 27, 2012 at 3:43 PM, david raistrick <drais () icantclick org> wro=
On Mon, 27 Feb 2012, William Herrin wrote:
In some cases this is because of carelessness: The application does a
gethostbyname once when it starts, grabs the first IP address in the
list and retains it indefinitely. The gethostbyname function doesn't
even pass the TTL to the application. Ntpd is/used to be one of the
notable offenders, continuing to poll the dead address for years after
the server moved.
While yes it often is carelessness - it's been reported by hardcore
development sorts that I trust that there is no standardized API to obtai=
the TTL... =A0What needs to get fixed is get[hostbyname,addrinfo,etc] so
programmers have better tools.
Meh. What should be fixed is that connect() should receive a name
instead of an IP address. Having an application deal directly with the
IP address should be the exception rather than the rule. Then, deal
with the TTL issues once in the standard libraries instead of
repeatedly in every single application.
No. connect() should stay the way it is. Most developers cut and paste
the connection code. It's just that the code they cut and paste is very
old and is often IPv4 only.
In theory, that'd even make the app code protocol agnostic so that it
doesn't have to be rewritten yet again for IPv12.
getaddrinfo() man page has IP version agnostic code examples. It
is however simplistic code which doesn't behave well when a address
is unreachable. For examples of how to behave better for TCP see:
Mark Andrews, ISC
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742 INTERNET: marka () isc org
Re: Reliable Cloud host ? Michael DeMan (Feb 26)
Re: Reliable Cloud host ? Alex Brooks (Feb 27)