fqdn does not accept terminal dot

Bug #1966533 reported by Evan Carroll
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

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 name

    foo.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.

Tags: bitesize
Revision history for this message
Evan Carroll (evancarroll) wrote :

This is inspired on my question and self-research here,

https://devops.stackexchange.com/q/15678/18965

description: updated
Revision history for this message
James Falcon (falcojr) wrote :

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.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
tags: added: bitesize
Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Fix Committed
James Falcon (falcojr)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.