[Gambas-user] System.Domain empty

Rob sourceforge-raindog2 at ...94...
Fri May 16 16:11:45 CEST 2008


On Friday 16 May 2008 05:12, Benoit Minisini wrote:
> So if you want to get the FQDN, you have to run "hostname -f" by
> hand. Apparently there is no function in the C library to get this
> information, as it requires some heavy process.

On my laptop, "hostname" and "hostname -f" print the same value, which 
does not include my domain, and even if it had given me the domain, 
the hostname plus the domain would not have resolved to anything 
because it's my router that has a hostname on the Internet, not my 
laptop.  

So, I don't know if even that's a reliable enough way of getting the 
FQDN.  If you're connected directly to the net, you could get the 
machine's IP address and do a reverse DNS lookup.  If not, maybe one 
of the "what is my IP" web sites has a web service you could use to 
get the "outside" IP and/or FQDN, assuming you're not behind a proxy 
as well.  

But I don't think it's something you can reliably get from the machine 
on which the program is running, because most machines aren't 
directly connected to the Internet anymore.

Rob




More information about the User mailing list