edeca.net logo
  • rss
  • Home
  • Graphics
  • Electronics
    • PCB0002 – LED matrix
  • Computing
    • ROT Util
    • MOTD maker
    • GNU screen config
    • VB6 reverse DNS
    • VB6 RichTextBox control
  • About

VB6 reverse DNS

Looking up an IP from a hostname is fairly easy in Visual Basic but resolving IP addresses to hostnames isn’t. However, IN PTR DNS records can be retrieved using the Winsock APIs quite easily.

The example contains a simple project that simply shows how to call the function and how to handle errors.

Note: This code is for Visual Basic 6, not the more recent .NET versions

Usage

1
2
3
4
5
6
7
8
' Initialise Windows Sockets
InitWSA

' Attempt to get hostname
MsgBox GetHost("127.0.0.1")

' Cleanup Windows Sockets
Cleanup

Download code

Download the VB6 module – The code on its own
Download an example project – Shows how to use the code

Comments rss
Comments rss
Trackback
Trackback

Leave a Reply

Click here to cancel reply.

 

Categories

  • Computing
  • Electronics
  • General
  • Perl
  • Photography
  • Uncategorized

Archives

  • February 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009

Links

  • My photo gallery
  • Pookey's site

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox