26278 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: May 31
May Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Nintendo throws
flaming legal
barrel at YouTubing
fans
Optus outlines its
4G future
Hold our tiny
silicon spheres,
say gravity wave
detection
scientists
EMC vuln gives mere
sysadmins the power
of storage admins
Four Anons cuffed
in Italy
IBM gives a cloudy
outlook for COBOL
Bureau of Stats
releases
educational
SimClone game
I know who "Satoshi
Nakamoto" is, says
Ted Nelson
Google builds
crowdsourcing into
new Maps code stack
Google"s Native
Code browser tech
goes cross-platform
Slashdot
Medical Firm Sues
IRS For 4th
Amendment Violation
In Records Seizure
Military Dolphins
Discover 1800s
Torpedo
Apple Mobile
Devices Cleared For
Use On US Military
Networks
Mice, Newts
Retrieved After a
Month Orbiting
Earth At 345 Miles
Up
IBM Takes System/z
To the Cloud With
COBOL Update
Google"s Nexus Q
Successor Hits the
FCC
Yahoo Board
Approves a $1.1B
Pricetag For Tumblr
Trade Group: US
Software Developer
Wages Fell 2% Last
Year
Wikileaks Releases
Docs Before Trial
of TPB Founder Warg
John McAfee"s
Belize Home Burns
To Ground
Article viewer

DNS Lookups in .NET



Written by:dimport
Published by:thinkt4nk
Published on:2003-06-21 07:19:46
Topic:Dot.Net
Search OSI about Dot.Net.More articles by dimport.
 viewed 13594 times send this article printer friendly

Digg this!
    Rate this article :
Microsoft know how to make things easy, and with Microsoft.NET most things are at your fingertips. Heres an example of doing a DNS Lookup in just two lines of code.

Not only can you do the lookup, but you also get a IPHostEntry object with all sorts of groovy properties!

Just try it out using the following code

(this syntax for this example is in VB.NET)

Dim objX As System.Net.IPHostEntry       
Dim strHostName As String
Dim strIPAddressAsString As String
       
Try
     'get the host dns entry   
     objX = System.Net.Dns.GetHostByAddress(strIPAddressAsString)

     'get the hostname property
     strHostName = objX.HostName          
 
Catch ex As Exception
 
     'something went wrong (possibly no entry)
 
End Try


This article was originally written by barnseyboy

Did you like this article? There are hundreds more.

Comments:
Anonymous
2007-11-13 00:30:48
was looking for a dns lookup utility in vb.net, found yours... 2 lines of code, elegant and useful, thank you :)
Anonymous
2008-03-18 02:46:49
This would be alot better if you removed the superfluous HTML codes...
ObatAsamUrat
2011-06-16 07:05:21
Wonderful release and anyone present to people can be correctly up-to-date along with genuinely valuable, I have to preserve your web site so we could occur below yet again to talk to your written content, because you have executed an exceptional operate.
obat asam urat
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Blogs: (People who have posted blogs on this subject..)
bb
ASP.NET RadioButton GroupName when inside a Repeater on Sun 10th Jun 8am
I was thankful on finding this nugget of code, which makes the groupname work out when slamming in radiobuttons in an asp.net repeater. http://www.codeguru.com/csharp/csharp/cs _controls/custom/article.php/c12371/


     
Your Ad Here
 
Copyright Open Source Institute, 2006