Skip to content

Conversation

@bcoles
Copy link
Contributor

@bcoles bcoles commented Jan 11, 2026

sigar_fqdn_get() returns an IP address when the system hostname is not a fully qualified domain name. Since we want the hostname in this case, check if the returned value is an IP address and fall back to sigar_net_info_get() to retrieve the actual hostname.

Also increase fqdn buffer size from SIGAR_MAXDOMAINNAMELEN (256) to SIGAR_FQDN_LEN (512) to properly accommodate FQDNs.

Fixes #239.

sigar_fqdn_get() returns an IP address when the system hostname
is not a fully qualified domain name. Since we want the hostname
in this case, check if the returned value is an IP address and
fall back to sigar_net_info_get() to retrieve the actual hostname.

Also increase fqdn buffer size from SIGAR_MAXDOMAINNAMELEN (256)
to SIGAR_FQDN_LEN (512) to properly accommodate FQDNs.
@github-project-automation github-project-automation bot moved this from Todo to In Progress in Metasploit Kanban Jan 15, 2026
@adfoster-r7 adfoster-r7 merged commit c679068 into rapid7:master Jan 16, 2026
31 of 36 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Metasploit Kanban Jan 16, 2026
@bcoles bcoles deleted the mettle-fqdn branch January 16, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

mettle_get_fqdn: Returns IP address not hostname

3 participants