This project has moved. For the latest updates, please go here.

using a server NAME instead of IP?

Feb 24, 2015 at 12:18 AM
hi, is it possible to use a server domain name (eg: www.site.com) instead of static IP (xxx.xxx.xxx.xxx)?
i see that example use :
public static string staticIp = "111.222.333.444"; //example lol
and for connect its using :
 if (!IPAddress.TryParse(staticIp, out serverIPAddress)) return
possible to use domain name then or not yet?
Coordinator
Feb 24, 2015 at 1:06 AM
I believe the socket types do allow domain names.
Feb 24, 2015 at 1:39 AM
replacing staticIp "111.222.333.444" by "odns.dynamic.org" gives me an error "Invalid IP Adress" .
What have i to change for it to work?
Feb 24, 2015 at 2:10 AM
time to sleep i guess, my brain didn't even though about built-in methods....
//automatic lol
    public static IPAddress[] tmpIp = Dns.GetHostAddresses("dsn.adress.com");
    public static string staticIp = tmpIp[0].ToString();
Marked as answer by Nammak on 2/23/2015 at 7:10 PM
Coordinator
Feb 24, 2015 at 12:38 PM
You could use DNS, yes.

What sample code are you referring to?
Feb 24, 2015 at 1:38 PM
oh it was only for testing what can really do or not this library. So i was using and modifying "simple client" project.
And this Library is really epic. Thanks you, owners, for that really nice work!