getaddrinfo not resolving fqdn with more than two levels depth

347 views Asked by At

getaddrinfo resolves google.com fine but when tries to resolve www.google.com (or any fqdn with more than two levels) it fails: "hostname nor servname provided, or not known".

When getaddrinfo tries to resolve www.google.com (for example), in the DNS server I see this query:

07:14:35.038219 IP A.B.C.D.13162 > W.X.Y.Z.53: 3863+ A? group_compat. (30)
07:14:35.038558 IP W.X.Y.Z.53 > A.B.C.D.13162: 3863 NXDomain 0/1/0 (105)

Any clue of what is going on? Thanks in advance.

1

There are 1 answers

0
Ernesto On

There was an ugly an subtle bug in the code itself: getaddrinfo hints structure was wrongly populated. Fixing that the application behaves correctly.