Infra/ansible/roles/pi_dnsmasq/templates/02-custom.conf.j2

23 lines
767 B
Plaintext
Raw Normal View History

2021-08-17 00:11:04 +02:00
{{ ansible_managed | comment }}
2021-02-13 15:39:14 +01:00
# http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
2020-10-28 22:15:23 +01:00
addn-hosts=/etc/hosts.custom
2021-08-17 00:11:04 +02:00
{% for alias in dnsmasq.aliases %}
address=/{{ alias.host }}/{{ alias.ip }}
{% endfor %}
2020-10-28 22:15:23 +01:00
2022-10-18 22:13:55 +02:00
{% for srv in dnsmasq.srv %}
srv-host=_{{ srv.service }}._{{ srv.protocol | default("tcp") | upper }}.{{ srv.domain }},{{ srv.url | default(srv.service + "." + srv.domain) }},{{ srv.port }}
{% endfor %}
2021-08-17 00:11:04 +02:00
{% for server in dnsmasq.servers %}
{% if server.reverse|default(False) %}
rev-server={{ server.mask }},{{ server.gateway }}
{% endif %}
{% if server.lookup|default(False) %}
server=/{{ (server.gateway.split("."))[:3] | reverse | join(".") }}.in-addr.arpa/{{ server.gateway }}
{% endif %}
server=/{{ server.host }}/{{ server.gateway }}
2021-02-13 15:39:14 +01:00
2021-08-17 00:11:04 +02:00
{% endfor %}