using System;
using System.Net;
namespace cShapNslookup
{
class Program
{
static void Main(string[] args)
{
string HostName = "";
HostName = "www.naver.com";
//실제 name 을 가져오기 위해 IPHostEntry을 이용
IPHostEntry hostEntry = Dns.GetHostByName(HostName);
Console.WriteLine("실제이름 : " + hostEntry.HostName + "");
//IP 주소를 찾아서 출력함
foreach (IPAddress ip in hostEntry.AddressList)
{
Console.WriteLine(ip.ToString());
}
}
}
}
댓글 없음:
댓글 쓰기