This commit is contained in:
ge
2026-04-04 00:47:35 +03:00
parent 4e43912583
commit 1cf6d878b5
19 changed files with 438 additions and 302 deletions
+16
View File
@@ -0,0 +1,16 @@
import netio
import os
fn main() {
// Resolve the fully qualified domain name for host.
// This programm is analog for `hostname -f` command.
hostname := os.hostname()!
ai := netio.translate_addr(node: hostname, flags: netio.ai_canonname)!
mut fqdn := ''
for a in ai {
// Not needed to iterate over all entries, return the first one per getaddrinfo(3).
fqdn = a.canonical
break
}
println(fqdn)
}