gethostbyname: Unknown server error when resolving hostnames with underscore

Bug #1674479 reported by Krzysztof Klimonda
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)
New
Undecided
Unassigned

Bug Description

This small snippet of code returns "gethostbyname: Unknown server error" when called under 14.04 and 16.04:

-----8<--------
#include <stdio.h>
#include <netdb.h>

int main(int argc, char *argv[])
{
    struct hostent *lh = gethostbyname("_http._tcp.nova.clouds.archive.ubuntu.com");

    if (lh)
        puts(lh->h_name);
    else
        herror("gethostbyname");
}
-----8<--------

While I have a feeling this hostname is not valid, that's what apt is trying to resolve after SRV query fails. The same code seems to be working in 16.10.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.