Score:0

How can I pass the FQDN hostname to systemd?

ng flag

I have an Ubuntu 20.04 system in AWS. The %H flag in systemd is replaced with the hostname as expected, but I need a way to capture the output of hostname --fqdn.

%H outputs ip-10-0-0-188 on my instance, but I want to get the equivalent of hostname --fqdn which outputs ip-10-0-0-188.ec2.internal. I am avoiding hardcoding %H.ec2.internal in case this ever changes in the future.

What is the best way to achieve this?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.