Skip to content

Commit

Permalink
Added anti-spoofing google recommandation
Browse files Browse the repository at this point in the history
  • Loading branch information
dtourde committed Mar 10, 2020
1 parent 4b4bdbb commit 130a9d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions roles/bind/templates/db.base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ $TTL 3600
@ IN NS sid.example.com.
@ IN MX 10 sid.example.com.

{% block google_anti_spoof %}
@ IN TXT "v=spf1 include:_spf.google.com ip4:{{item.dns_ipv4}}/32 ptr:{{item.dns_fqdn}} ~all"
@ IN SPF "v=spf1 include:_spf.google.com ip4:{{item.dns_ipv4}}/32 ptr:{{item.dns_fqdn}} ~all"
{% endblock %}

{% block records %}
{% for key, type_record in item.records.items() %}
{% for record in type_record %}
Expand Down
7 changes: 4 additions & 3 deletions roles/bind/vars/example_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
zones:
- name: "{{domain_name_1}}"
dns_fqdn: "ns1.{{domain_name_1}}."
dns_ipv4: &ip_ns_1 "{{public_ip_addr}}"
soa_email: damien.tourde.example.
allow_transfer:
- gandi-net
Expand All @@ -82,7 +83,7 @@
A:
- name: ""
inet_class: IN
record: "{{public_ip_addr}}"
record: *ip_ns_1
CNAME:
- name: plex
inet_class: IN
Expand All @@ -95,6 +96,7 @@
record: ""
- name: "{{domain_name_2}}"
dns_fqdn: "ns1.{{domain_name_2}}."
dns_ipv4: &ip_ns_2 "5.6.7.8"
soa_email: damien.tourde.second-example.
allow_transfer:
- gandi-net
Expand All @@ -120,7 +122,7 @@
A:
- name: ""
inet_class: IN
record: "{{public_ip_addr}}"
record: *ip_ns_2
CNAME:
- name: plex
inet_class: IN
Expand All @@ -139,4 +141,3 @@
# reverse: True
# db_name: "db.{{domain_name_1}}.inv"


0 comments on commit 130a9d0

Please sign in to comment.