Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching FQDN? #13

Open
jszwedko opened this issue Apr 5, 2021 · 2 comments
Open

Fetching FQDN? #13

jszwedko opened this issue Apr 5, 2021 · 2 comments

Comments

@jszwedko
Copy link

jszwedko commented Apr 5, 2021

Thanks for this crate!

I was just wondering what you thought about adding a mechanism to fetch the fully qualified domain name (similar to hostname --fqdn).

@svartalf
Copy link
Owner

svartalf commented Apr 7, 2021

Yeah, it would be nice to have it, but it needs a bit more investigation first how would it work both for Windows and POSIX-compatible systems.

So far it looks like GetComputerNameExW in combination with ComputerNamePhysicalDnsFullyQualified flag can be used for Windows.
As for POSIX, seems like this approach would be our solution.

It sounds promising so far, but it would be better to double check everything first.

@thecaralice
Copy link

thecaralice commented Sep 5, 2024

I should note that GNU libc apparently returns FQDN for gethostname: https://www.gnu.org/software/libc/manual/html_node/Host-Identification.html. And macOS does that too.
I mean, I stumbled upon this issue while I was searching why a certain Rust utility gives a different hostname from its original bash version which uses scutil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants