[Bug 1674479] [NEW] gethostbyname: Unknown server error when resolving hostnames with underscore

Krzysztof Klimonda kklimonda at syntaxhighlighted.com
Mon Mar 20 21:41:54 UTC 2017


Public bug reported:

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.

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1674479

Title:
  gethostbyname: Unknown server error when resolving hostnames with
  underscore

Status in glibc package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1674479/+subscriptions



More information about the foundations-bugs mailing list