Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C#] DNS to IP [Beginner]
#1
This one is very simple. Everybody should now how to do this.

Imports:
Code:
using System.Net;

Code:
Code:
static string DNStoIP(string DNS)
        {
            try
            {
                IPHostEntry DNSHosts = Dns.GetHostEntry(DNS);
                IPAddress[] DNSIPs = DNSHosts.AddressList;
                return Convert.ToString(DNSIPs[0]);
            }
            catch (Exception ex)
            {
                throw ex;
            }

Usage:
Code:
Console.WriteLine(DNStoIP("google.com"));
Reply


Messages In This Thread
[C#] DNS to IP [Beginner] - by Mike - 08-31-2010, 12:38 PM
RE: [C#] DNS to IP [Beginner] - by xHtmlPhP - 09-02-2010, 08:02 PM
RE: [C#] DNS to IP [Beginner] - by Sιℓνєя - 09-03-2010, 04:57 AM
RE: [C#] DNS to IP [Beginner] - by Mike - 09-03-2010, 11:16 PM
RE: [C#] DNS to IP [Beginner] - by flAmingw0rm - 09-05-2010, 07:14 AM
RE: [C#] DNS to IP [Beginner] - by pers2981 - 09-09-2010, 06:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Beginner] Simple Function for retrieving Local Computer IP AceInfinity 11 3,920 10-06-2010, 12:05 PM
Last Post: CATMAN
  [Tut] How to make an auto text spammer in vb 2008. [Beginner] DeMeR 4 4,256 10-04-2010, 07:57 AM
Last Post: Jordan L.
  [C#] Random Integers [Beginner] Mike 0 674 08-31-2010, 12:57 PM
Last Post: Mike
  [Tut] Find color on screen | Good for beginner bots [VB.Net] mmki 13 11,094 08-18-2010, 05:44 AM
Last Post: mmki
  beginner, help in vb.net[solved] k1ll3r 6 2,053 10-12-2009, 03:29 AM
Last Post: k1ll3r

Forum Jump:


Users browsing this thread: 2 Guest(s)