From 5622e90993187e91e88dccd072c7201a216fd71d Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Sat, 10 Sep 2016 14:09:51 -0700 Subject: [PATCH] make nameservers configurable I chose the defaults based on namebench results. Users in other geographical areas likely want to choose other servers. --- group_vars/all | 5 +++++ roles/unbound/templates/unbound.conf.j2 | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/group_vars/all b/group_vars/all index b77d100..61d5c21 100644 --- a/group_vars/all +++ b/group_vars/all @@ -114,3 +114,8 @@ tor: localtime: run_on: trusted + +nameservers: + - 8.8.8.8 # Google + - 205.171.3.25 # Qwest + - 74.82.42.42 # Hurricane Electric diff --git a/roles/unbound/templates/unbound.conf.j2 b/roles/unbound/templates/unbound.conf.j2 index 94e0979..13b0bbc 100644 --- a/roles/unbound/templates/unbound.conf.j2 +++ b/roles/unbound/templates/unbound.conf.j2 @@ -21,9 +21,11 @@ server: private-address: fd00::/8 private-address: fe80::/10 +{% if nameservers %} # Define DNS servers to forward queries to. forward-zone: name: "." - forward-addr: 8.8.8.8 # Google - forward-addr: 205.171.3.25 # Qwest - forward-addr: 74.82.42.42 # Hurricane Electric + {% for nameserver in nameservers %} + forward-addr: {{ nameserver }} + {% endfor %} +{% endif %}