socket.gethostbyaddr() wrongly returning a DNS CNAME as the 'primary' hostname

cjblaine cjblaine at gmail.com
Thu Apr 28 22:18:13 CEST 2011


Thanks for the reply, Ned.

Bummer for me.  Check this out:

C code on Solaris 10 SPARC returns the following with nscd
running (the Solaris Naming Services Caching Daemon, on by
default):

  PRIMARY according to gethostbyaddr(): my-dns-cname.our.org
  ALIAS according to gethostbyaddr(): primary.our.org

  However, I can stop/start nscd and get the complete opposite
  (correct) result.

C code on Solaris 10 SPARC returns the following with nscd
OFF:

  PRIMARY according to gethostbyaddr(): my-dns-cname.our.org
  ALIAS according to gethostbyaddr(): primary.our.org

  These then ALTERNATE consistently with every successive
  invocation of my code.

C code on Linux 2.6 with glibc 2.5 returns:

  PRIMARY according to gethostbyaddr(): primary.our.org
  [ no aliases get listed ]

Time to query the corporate DNS folks.



More information about the Python-list mailing list