Fully Qualified Domain name - Retrievable?

(imported topic written by Steve91)

Hi Chaps,

I’m trying to retrieve the fqdn for some servers and at the moment I’ve only come up with the following relevance:

if value “ProductType” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions” of registry != “WinNT” then (value “Hostname” of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters” of registry as string & “.” as string & value “Domain” of key “HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters” of registry as string) else “Workstation”

It’s a bit messy but it does the job in most cases, the only problem is that some servers don’t have a value for “Domain” in the registry so I’m only able to return their hostname.

Is there a cleaner way to retrieve the fqdn?

Cheers

Steve

(imported comment written by BenKus)

Hey Steve,

We have an inspector (and built-in default property) that is called

dns name

that will return the current DNS name of the computer (as registered by the OS). If the computer is part of a domain, it will generally report the FQDN, but if it is not part of a domain then it generally reports hostname.

Will that work for you?

If a computer is not in a domain, is there such a thing as a FQDN?

Ben