From: Rainer Weikusat on
"David Schwartz" <davids(a)webmaster.com> writes:
> On Feb 1, 10:20 am, Rainer Weikusat <rainer.weiku...(a)sncag.com> wrote:
>> RFC1035 says:
>>
>> The DNS assumes that messages will be transmitted as datagrams
>> or in a byte stream carried by a virtual circuit. While
>> virtual circuits can be used for any DNS activity, datagrams
>> are preferred for queries due to their lower overhead and
>> better performance.
>
> I think you may be misunderstanding what this paragraph is saying.
> It's saying that this assumption is made in the design of the
> protocol, that is, the protocol is designed to always correctly handle
> loss of packets.

That would be an not entirely unreasonable guess based on the first
sentence of the cited text. But the DNS protocol does not deal with
packet loss and the actually important part is in the second sentence:

[...], datagrams are preferred for queries due [...]

> It's not saying that in the real world DNS will
> actually be transmitted as datagrams.

Actually, no. It demands the DNS queries/ responses should be
transmitted as datagrams and 'usual implementation' do this.

>> UDP is not acceptable for zone transfers, but is the
>> recommended method for standard queries in the Internet.
>
>> IMO, calling the DNS protocol 'UDP-based' is appropriate because of
>> this and because simplifications tend to make things simpler to
>> explain (and understand).
>
> I think it's dangerous. TCP is supposed to be equally supported and
> saying things like this may mislead people into thinking they are not
> requires to support queries over TCP in a server or are not allowed to
> perform such queries in a client.

It is likely that implementations of anything done without knowing the
specification behave strangely in various respects, although this has
not yet stopped anyone from implementing them or prevented those
implementations from being 'fairly successful' (busybox) or
'commercially viable' (eg what Conexant-DSL-modems call 'telnet' --
the most original idea being the use of LFCR as line terminator).

But this is not really relevant in the context of understanding the
behaviour of a 'usual' C-library stub resolver, called via one the
various defined frontends (like gethostbyname).
From: Bin Chen on
On 2ÔÂ1ÈÕ, ÏÂÎç12ʱ44·Ö, Christopher Layne <cla...(a)com.anodized> wrote:
> Also, stay away fromgethostbyname() and any of it's devil child variants. Use
> getaddrinfo() and getnameinfo().

What is the advantages that getaddrinfo() over gethostbyname()? From
the man pages it only emphasizes getaddrinfo() is thread safe, seems
no direct relation to the OP's question that concerns timeout feature.

From: Rainer Weikusat on
"Bin Chen" <binary.chen(a)gmail.com> writes:
> On 2��1��, ����12ʱ44��, Christopher Layne <cla...(a)com.anodized> wrote:
>> Also, stay away fromgethostbyname() and any of it's devil child variants. Use
>> getaddrinfo() and getnameinfo().
>
> What is the advantages that getaddrinfo() over gethostbyname()? From
> the man pages it only emphasizes getaddrinfo() is thread safe, seems
> no direct relation to the OP's question that concerns timeout feature.

In the context of the quote you are referring to: gethostbyname and
gethostbyaddr are interface that were designed in the 1980's and the
academic theory wrt how a sensible tradeoff should look like has
changed quite a lot since then.

There are no real practical advantages if the functionality is
sufficient.
From: Bin Chen on
On Mar 2, 5:26 pm, Rainer Weikusat <rainer.weiku...(a)sncag.com> wrote:
> "Bin Chen" <binary.c...(a)gmail.com> writes:
> > On 2ÔÂ1ÈÕ, ÏÂÎç12ʱ44·Ö, Christopher Layne <cla....(a)com.anodized> wrote:
> >> Also, stay away fromgethostbyname() and any of it's devil child variants. Use
> >> getaddrinfo() and getnameinfo().
>
> > What is the advantages that getaddrinfo() over gethostbyname()? From
> > the man pages it only emphasizes getaddrinfo() is thread safe, seems
> > no direct relation to the OP's question that concerns timeout feature.
>
> In the context of the quote you are referring to: gethostbyname and
> gethostbyaddr are interface that were designed in the 1980's and the

What's the matter of my quote?


From: Rick Jones on
Bin Chen <binary.chen(a)gmail.com> wrote:
> On 2??1??, ????12??44??, Christopher Layne <cla...(a)com.anodized> wrote:
>> Also, stay away fromgethostbyname() and any of it's devil child variants. Use
>> getaddrinfo() and getnameinfo().

> What is the advantages that getaddrinfo() over gethostbyname()? From
> the man pages it only emphasizes getaddrinfo() is thread safe, seems
> no direct relation to the OP's question that concerns timeout feature.

getaddrinfo() includes support for IPv6 addresses and simultaneous
servicce lookups. It also fills-in sockaddr structures more directly
and allows one to pass them to calls such as bind(), or connect()
without further ado.

rick jones
--
Wisdom Teeth are impacted, people are affected by the effects of events.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...