Skip to content

hostname: print (none) when --domain has no DNS domain - #15407

Open
Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix/14962-hostname-domain-none
Open

Franklin-Qi wants to merge 1 commit into
uutils:mainfrom
Franklin-Qi:fix/14962-hostname-domain-none

Conversation

@Franklin-Qi

@Franklin-Qi Franklin-Qi commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

When the host name has no ., GNU hostname --domain prints (none). Match that instead of writing an empty line.

Closes: #14962

Comment thread src/uu/hostname/src/hostname.rs Resolved

@sylvestre sylvestre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the slow reaction!

Comment thread src/uu/hostname/src/hostname.rs Resolved
Comment thread tests/by-util/test_hostname.rs Resolved
Comment thread tests/by-util/test_hostname.rs Resolved
Match net-tools hostname -d: derive the DNS domain from the host name and
print nothing when there is no '.'. Factor helpers and add unit tests that
always run.
@Franklin-Qi
Franklin-Qi force-pushed the fix/14962-hostname-domain-none branch from d0f700b to 14f7f62 Compare December 4, 2026 09:03
@codspeed

codspeed Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 13.42%

2 warnings

⚠️ 3 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

⚠️ 2 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

❌ 2 regressed benchmarks
✅ 4 untouched benchmarks
⏩ 496 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation socket_addrs_direct[100000] 105.3 µs 133.2 µs -20.91%
❌ CPU Simulation hostname_ip_lookup[100000] 546.5 µs 576.5 µs -5.21%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing Franklin-Qi:fix/14962-hostname-domain-none (14f7f62) with main (3ef8203)

Open in CodSpeed

Footnotes

  1. 496 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

hostname: when domain is none, it should be outputted to stdout

4 participants