Skip to content

Commit

Permalink
Option to set specific DNS servers for hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvijge committed Jul 23, 2024
1 parent 659886b commit 2bc8a28
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/dhcp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ config dnsmasq
list rebind_domain '{{ domain }}'
{% endfor %}
{% endif %}
{% if dhcp is defined and dhcp.tags is defined %}
option strictorder '1'
{% endif %}

{% for _, network in networks.items() %}
{% if _ not in ('wan','additional') %}
Expand Down
9 changes: 9 additions & 0 deletions config/dnsmasq.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,12 @@ address=/dualstack.apiproxy-website-nlb-prod-2-b4de62b516adfbbf.elb.eu-west-1.am
server=/dualstack.apiproxy-website-nlb-prod-1-5675d5ecda6efdd8.elb.eu-west-1.amazonaws.com/#
address=/dualstack.apiproxy-website-nlb-prod-1-5675d5ecda6efdd8.elb.eu-west-1.amazonaws.com/::
{% endif %}

{% if dhcp.tags is defined %}
{% for tag in dhcp.tags %}
{% for host in tag.hosts %}
dhcp-host={{ host }},set:{{ tag.tag }}
{% endfor %}
dhcp-option=tag:{{ tag.tag }},option:dns-server,{{ tag.server | join(',') }}
{% endfor %}
{% endif %}
10 changes: 10 additions & 0 deletions inventory-sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,13 @@ openwrt:
# retrieved.
upnp:
configure_with_external_ip: false
dhcp:
domain_whitelist:
- plex.direct
tags:
- tag: CloudFlareFamily
server:
- 1.1.1.3
- 1.0.0.3
hosts:
- DD:45:4F:4A:2E:99

0 comments on commit 2bc8a28

Please sign in to comment.