Re: DNS lookups not working with freetds

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4ccJOwBQMEqNNiCpruc_fwwkWp_xrCBFNP1r6xzmU1sjA@mail.gmail.com>
2016-04-27 1:17 GMT+01:00 Peter Deacon <[email protected]>:
> Tried current freetds and name lookups are not working at all with some
> older Linux systems for me.  Everything that isn't an IP address returns -2
> (EAI_NONAME)
>
> The problem is triggered by setting ai_flags = AI_ADDRCONFIG in hints field
> of getaddrinfo and resolved by setting ai_flags = 0.
>
> From what I've read in various man pages for getaddrinfo when set to 0
> defaults are designed to be reasonable usually including AI_ADDRCONFIG
> anyway.
>
> Would switching to default for ai_flags break anything for anyone?
>
> thanks,
> ~Peter


The commit that introduced the flag is
https://github.com/FreeTDS/freetds/commit/25edb8ef.

I don't remember exactly but I don't remember all the problems. I
think that without the flag some environment can send multiple queries
and you increase the connection timeout in environment where the DNS
do not return AAAA records. Unfortunately these environments were
quite common :-(
I don't know... possible todos/solutions:
- look at the old ML thread(s) and try to understand why this flag was
used (if I remember there were multiple threads);
- add a freetds.conf option;
- if getaddrinfo returns EAI_NONAME try without the flag. This would
slow down connections only if users really used a wrong host name,
should not that common.

Frediano
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.