Skip to Content.
Sympa Menu

freetds - Re: [freetds] DNS lookups not working with freetds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] DNS lookups not working with freetds
  • Date: Wed, 27 Apr 2016 15:32:12 +0100

2016-04-27 1:17 GMT+01:00 Peter Deacon <peterd AT iea-software.com>:
> 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




Archive powered by MHonArc 2.6.24.

Top of Page