Validating IP Addresses
-
Hi All, I'm just working with the Dns class and have a need to use IP addresses. At the moment I'm just retrieving a list of IP addresses using the GetHostByName method and then validing the format of each IP address. The issue is that I'm then going to use this as a base for producing some service endpoints. I want to make sure that the IP address I use is correct for the machines identity on our network rather than just grabbing the first IP address in the list which seems a bit random. Should I be calling a domain controller and confirming with it that the IP address I plan to use is the 'correct' one? Cheers,
Jammer My Blog | Article(s)
-
Hi All, I'm just working with the Dns class and have a need to use IP addresses. At the moment I'm just retrieving a list of IP addresses using the GetHostByName method and then validing the format of each IP address. The issue is that I'm then going to use this as a base for producing some service endpoints. I want to make sure that the IP address I use is correct for the machines identity on our network rather than just grabbing the first IP address in the list which seems a bit random. Should I be calling a domain controller and confirming with it that the IP address I plan to use is the 'correct' one? Cheers,
Jammer My Blog | Article(s)
I'd imagine if the Dns class returned the IP address for the hostname you were looking for (or the other way around), then that would be the correct IP address. If it is the wrong IP address, the host you are looking for either changed names or is offline.
-
I'd imagine if the Dns class returned the IP address for the hostname you were looking for (or the other way around), then that would be the correct IP address. If it is the wrong IP address, the host you are looking for either changed names or is offline.
Hi, Actually I'm using IPEntry on the machine I want to get the network IP for. When using IPEntry you get back IPAddress[] so currently I'm just taking the entry at position 0 which to me seems a bit prone to errors to rely on there being the actual machine network IP address at position 0. Cheers,
Jammer My Blog | Article(s)