summaryrefslogtreecommitdiff
path: root/src/services/vyos-hostsd
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/vyos-hostsd')
-rwxr-xr-xsrc/services/vyos-hostsd9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/services/vyos-hostsd b/src/services/vyos-hostsd
index 972c2e3dc..aec06c72c 100755
--- a/src/services/vyos-hostsd
+++ b/src/services/vyos-hostsd
@@ -38,6 +38,9 @@ HOSTS_FILE = '/etc/hosts'
hosts_tmpl_source = """
### Autogenerated by VyOS ###
+### Do not edit, your changes will get overwritten ###
+
+# Local host
127.0.0.1 localhost
127.0.1.1 {{ host_name }}{% if domain_name %}.{{ domain_name }}{% endif %}
@@ -48,7 +51,7 @@ ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
-
+# From DHCP and "system static host-mapping"
{%- if hosts %}
{% for h in hosts -%}
{{hosts[h]['address']}}\t{{h}}\t{% for a in hosts[h]['aliases'] %} {{a}} {% endfor %}
@@ -60,6 +63,8 @@ hosts_tmpl = jinja2.Template(hosts_tmpl_source)
resolv_tmpl_source = """
### Autogenerated by VyOS ###
+### Do not edit, your changes will get overwritten ###
+
{% for ns in name_servers -%}
nameserver {{ns}}
{% endfor -%}
@@ -83,7 +88,7 @@ resolv_tmpl = jinja2.Template(resolv_tmpl_source)
# {"server": {"tag": <str>}}
#
# Hosts entries are similar:
-# {"host": {"tag": <str>, "address": <str>}}
+# {"host": {"tag": <str>, "address": <str>, "aliases": <str list>}}
#
# The tag is either "static" or "dhcp-<intf>"
# It's used to distinguish entries created