- Home /
Perform DNS Lookup To Get IP Address
how would I perform a DNS lookup to get the IP address of the selected hostname. for example hostname: google.com to get ip address: 74.125.230.142
Comment
$$anonymous$$ryptos - $$anonymous$$aybe because im trying to do the DNS lookup inside Unity (Program$$anonymous$$g).
Best Answer
Answer by tobiass · Aug 10, 2012 at 11:53 AM
In C#, use the Dns Class: http://msdn.microsoft.com/en-us/library/ms143998%28v=vs.90%29
This method will block until a result is found. This can block your program if no dns resolution is available (e.g. no network).
Sweet! Worked easily in editor, but any idea if this will run on iOS? I'll try it out when I have a chance...