On Tue, 08 Nov 2016 21:49:07 GMT, Alexey Kulentsov wrote:
Hi!
I have a problem with host name resolving - requestHTTP can't resolve any name, but works with IP addresses only. For example, I can dig or NSLookup api.sendgrid.com:
crimaniak@crimaniak-X550LB:~$ nslookup api.sendgrid.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: api.sendgrid.com Address: 159.122.224.201 Name: api.sendgrid.com Address: 159.122.224.200
but next code gives me exception:
enum mailEndpoint = "https://api.sendgrid.com/v3/mail/send"; ... return requestHTTP(mailEndpoint, (scope HTTPClientRequest request){ request.method = HTTPMethod.POST; request.headers["Authorization"] = "Bearer "~apiKey; ... });
From both static unittest block and real test page requested from browser. How to debug this issue?
Thanks.object.Exception@../../.dub/packages/vibe-d-0.7.30/vibe-d/source/vibe/core/drivers/libevent2.d(270): Failed to lookup host 'api.sendgrid.com': nodename nor servname provided, or not known (...)
Would be interesting to see if there are any related known issues/questions for libevent. There is a ticket that might be related, where libevent fails to use a second configured name server for lookups: #1612
Does your resolv.conf (or the files in /etc/resolvconf/resolf.conf.d/ or the NetworkManager configuration) contain multiple name servers?