title: C++ reverse dns lookup (on local network)
body: <p>I'm currently working on a "list what's up in the local network"-tool and now i'm stuck at the "gimme a hostname for this IP"-part.</p>
  
  <p>I already tried getnameinfo and gethostbyaddr, but the first one returns (almost) always the given IP instead of a hostname, the second one returns some strange stuff like <code>ANantes-651-1-49-net.w2-0.abo.wanadoo.fr</code>...</p>
  
  <p>My question is: How could i make this work?</p>
  
  <p>Note: It's not like there is no hostname associated with at least one of the IPs, for example <code>dig +short -x 192.168.178.1</code> return <code>fritz.box.</code> as it should and also <code>host 192.168.178.1</code> gives the correct answer
  <code>1.178.168.192.in-addr.arpa domain name pointer fritz.box.</code></p>
  
  <p>Additional note: On my research i stumbled upon a library, called "adns", but by "stumbled upon" i mean "almost literally stumbled upon", as there's not the slightest trace of a documentation, examples or such... So if someone actually has an example on how to use "adns", that would be great...</p>