summaryrefslogtreecommitdiffstats
path: root/etc/inc/unbound.inc
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2011-10-01 05:08:30 +0200
committerWarren Baker <warren@decoy.co.za>2011-10-01 05:08:30 +0200
commitdf74eeb07ba2f49c2d0dec3b96543df233f9fd1f (patch)
tree544402b271cb39b2f0dc62b19dd396d455f6883a /etc/inc/unbound.inc
parent7e0d217d29ee5404ee4c6f96694ef5f403155d6c (diff)
downloadpfsense-df74eeb07ba2f49c2d0dec3b96543df233f9fd1f.zip
pfsense-df74eeb07ba2f49c2d0dec3b96543df233f9fd1f.tar.gz
add ability to get root hints file
Diffstat (limited to 'etc/inc/unbound.inc')
-rw-r--r--etc/inc/unbound.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc
index 00949a1..ed5d5f2 100644
--- a/etc/inc/unbound.inc
+++ b/etc/inc/unbound.inc
@@ -128,5 +128,21 @@ function unbound_optimization() {
return $optimization;
}
+function unbound_fetch_root_hints() {
+ global $g;
+
+ $hints = "{$g['unbound_chroot_path']}/etc/root.hints";
+ if (@filesize($hints) == 0 ) {
+ conf_mount_rw();
+ $returnvar = mwexec("/usr/bin/dig +tcp +nocmd +answer @`/usr/bin/dig +nocmd +noall +answer +short . NS | /usr/bin/head -1` . NS > {$hints}");
+ conf_mount_ro();
+ if ($returnvar != 0) {
+ mwexec("/bin/rm -f {$hints}");
+ return false;
+ } else
+ return true;
+ } else
+ return true;
+}
?> \ No newline at end of file
OpenPOWER on IntegriCloud