Closed ubuntu-server-builder closed 1 year ago
Launchpad user Evan Carroll(evancarroll) wrote on 2022-03-26T01:18:21.717561+00:00
This is inspired on my question and self-research here,
Launchpad user James Falcon(falcojr) wrote on 2022-03-28T15:29:29.780441+00:00
Thanks for this bug report. Since hostname setting is implementation dependent, we should include a note in the docs that some tools don't accept the trailing dot.
Launchpad user James Falcon(falcojr) wrote on 2022-04-26T13:33:38.597823+00:00
Doc was updated in https://github.com/canonical/cloud-init/pull/1365
This bug was originally filed in Launchpad as LP: #1966533
Launchpad details
Launchpad user Evan Carroll(evancarroll) wrote on 2022-03-26T01:17:58.811130+00:00
A fully qualified domain is not
foo.bar.com
But instead,
foo.bar.com.
Otherwise the fqdn hit up the resolver and searches on the network for a matching host. So if the resolver is on network
foobar.com.
And you query for
foo.bar.com
it'll look up a host by that namefoo.bar.com.foobar.com.
To stop this you fully-qualify with a terminal dot. This creates a problem because hostname does not accept a terminal dot,
sudo hostname host-10-2-65-89.openstack.build. hostname: the specified hostname is invalid
And cloud-init blindly submits the input to hostname. Which is weird, because you have to supply an fqdn which actually can not currently be a fqdn. The desired fix for this would be to trim off the dot from the value supplied in fqdn, before providing it to hostname.