summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordermotbradley <dermot_bradley@yahoo.com>2021-10-26 23:08:53 +0100
committerGitHub <noreply@github.com>2021-10-26 17:08:53 -0500
commit75b26b0afbb14cf613fe3b08c8bed050dec0b874 (patch)
tree9a40080364f5a16f3227f48001336eb1821829c3
parent994339ae3cc0fc2008f498d70cfe12b29be5ed55 (diff)
downloadvyos-cloud-init-75b26b0afbb14cf613fe3b08c8bed050dec0b874.tar.gz
vyos-cloud-init-75b26b0afbb14cf613fe3b08c8bed050dec0b874.zip
hosts.alpine.tmpl: rearrange the order of short and long hostnames (#1084)
The Alpine /etc/hosts template results in a file where the long form of names (including localhost) come before the short form. This means that when running tools like 'netstat' and 'ss' which convert IP address to names that their output will show 'localhost.localdomain' rather than 'localhost.' This patch swaps the order of the short and long form names so such utils will show the short form name. It also removes several unnecessary IPv6-specific entries.
-rw-r--r--templates/hosts.alpine.tmpl13
1 files changed, 5 insertions, 8 deletions
diff --git a/templates/hosts.alpine.tmpl b/templates/hosts.alpine.tmpl
index 33c1a941..98ae55e6 100644
--- a/templates/hosts.alpine.tmpl
+++ b/templates/hosts.alpine.tmpl
@@ -13,16 +13,13 @@ you need to add the following to config:
# /etc/cloud/cloud.cfg or cloud-config from user-data
#
# The following lines are desirable for IPv4 capable hosts
-127.0.1.1 {{fqdn}} {{hostname}}
-127.0.0.1 localhost.localdomain localhost
-127.0.0.1 localhost4.localdomain4 localhost4
+127.0.1.1 {{hostname}} {{fqdn}}
+127.0.0.1 localhost localhost.localdomain
+127.0.0.1 localhost4 localhost4.localdomain4
# The following lines are desirable for IPv6 capable hosts
-::1 {{fqdn}} {{hostname}}
-::1 localhost6.localdomain6 localhost6
+::1 {{hostname}} {{fqdn}}
+::1 localhost6 localhost6.localdomain6
-fe00::0 ip6-localnet
-ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
-ff02::3 ip6-allhosts