[Mono-list] Getting list of IPAddress available
Matt Nuzum
matt@followers.net
Mon, 29 Nov 2004 22:21:23 -0500
On Mon, 29 Nov 2004 12:14:59 -0800, Jim P. <mono@cinemanage.com> wrote:
> Dns.GetHostByName (Dns.GetHostName());
I tried it on my computer and get the correct output. On my computer:
~/ $ hostname
matt
~/ $ host 192.168.0.55
55.0.168.192.in-addr.arpa domain name pointer matt.
~/ $ host matt
matt.newz.gotdns.com has address 192.168.0.55
$ mono gethostname.exe
Local Machine's Host Name: matt
Number of available IPs: 1
IP Address 0: 192.168.0.55
Note that your code merely asks the computer what it refers to itself
as and then does a DNS lookup on that info. This is heavily dependent
on a well-maintained network. (not that I know another way though)
--
Matthew Nuzum <matt@followers.net>
www.followers.net - Makers of "Elite Content Management System"
View samples of Elite CMS in action by visiting
http://www.followers.net/portfolio/