Is there any api or function to convert a short computer name (computer210) to a fully qualified domain name (computer210.test.mycompany.com)? I m under Delphi if it's matter.
Asked
Active
Viewed 283 times
0
-
[GetComputerNameEx()](https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getcomputernameexw) – Olivier Jun 29 '20 at 19:11
-
Does this answer your question? [How to get fully qualified domain name on Windows in Delphi](https://stackoverflow.com/questions/8446940/how-to-get-fully-qualified-domain-name-on-windows-in-delphi) – mirtheil Jun 29 '20 at 19:17
-
@Olivier But I don't understand GetComputerNameEx() is for my local computer so How I can convert computer210 to computer210.test.mycompany.com when computer210 is not my local computer ? – zeus Jun 29 '20 at 19:52
-
@mirtheil same answer I made for Olivier, your link point to GetComputerNameEx() and It's only for my local computer – zeus Jun 29 '20 at 19:55
-
1You can use `GetComputerNameEx()` to get the domain name (use the `ComputerNameDnsDomain` type) and append it to the computer name. – Olivier Jun 29 '20 at 20:07
-
what you mean under *convert* ? if task - get name, but not convert - need call `LsaQueryInformationPolicy` with `PolicyDnsDomainInformation` and `PolicyAccountDomainInformation`. you faster of all want `DnsDomainName` from `POLICY_DNS_DOMAIN_INFO` – RbMm Jun 29 '20 at 21:14