* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9aa7b0469da00d4ba745b682f0c5874ffa8ac92d
@ 2016-10-03 15:58 git
0 siblings, 0 replies; only message in thread
From: git @ 2016-10-03 15:58 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 3283 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, next has been updated
via 9aa7b0469da00d4ba745b682f0c5874ffa8ac92d (commit)
via f75c279b97552118ee06ae660230465d0a469bc8 (commit)
from 52587edac4f6e3fba0923cb808740de6c5cbd61e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9aa7b0469da00d4ba745b682f0c5874ffa8ac92d
Merge: f75c279 52587ed
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Mon Oct 3 17:55:42 2016 +0200
Merge branch 'next' of git.ipfire.org:/pub/git/ipfire-2.x into next
commit f75c279b97552118ee06ae660230465d0a469bc8
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Mon Oct 3 17:53:13 2016 +0200
unbound: fix reverse lockup of webif defined hosts
and make the own host resolveable.
Signed-off-by: Arne Fitzenreiter <arne_f(a)ipfire.org>
-----------------------------------------------------------------------
Summary of changes:
src/initscripts/init.d/unbound | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
Difference in files:
diff --git a/src/initscripts/init.d/unbound b/src/initscripts/init.d/unbound
index dd5c85c..d324457 100644
--- a/src/initscripts/init.d/unbound
+++ b/src/initscripts/init.d/unbound
@@ -44,6 +44,15 @@ function cidr() {
echo "${cidr}/${nbits}"
}
+ip_address_revptr() {
+ local addr=${1}
+
+ local a1 a2 a3 a4
+ IFS=. read -r a1 a2 a3 a4 <<< ${addr}
+
+ echo "${a4}.${a3}.${a2}.${a1}.in-addr.arpa"
+}
+
read_name_servers() {
local i
for i in 1 2; do
@@ -101,6 +110,23 @@ update_forwarders() {
unbound-control -q forward off
}
+own_hostname() {
+ local hostname=$(hostname -f)
+ # 1.1.1.1 is reserved for green only, skip this
+ if [ -n "${GREEN_ADDRESS}" -a "${GREEN_ADDRESS}" != "1.1.1.1" ]; then
+ unbound-control -q local_data "${hostname} ${LOCAL_TTL} IN A ${GREEN_ADDRESS}"
+ fi
+
+ local address
+ for address in ${GREEN_ADDRESS} ${BLUE_ADDRESS} ${ORANGE_ADDRESS}; do
+ [ -n "${address}" ] || continue
+ [ "${address}" = "1.1.1.1" ] && continue
+
+ address=$(ip_address_revptr ${address})
+ unbound-control -q local_data "${address} ${LOCAL_TTL} IN PTR ${hostname}"
+ done
+}
+
update_hosts() {
local enabled address hostname domainname
@@ -111,6 +137,10 @@ update_hosts() {
local fqdn="${hostname}.${domainname}"
unbound-control -q local_data "${fqdn} ${LOCAL_TTL} IN A ${address}"
+
+ # Add RDNS
+ address=$(ip_address_revptr ${address})
+ unbound-control -q local_data "${address} ${LOCAL_TTL} IN PTR ${fqdn}"
done < /var/ipfire/main/hosts
}
@@ -307,6 +337,9 @@ case "$1" in
boot_mesg "Starting Unbound DNS Proxy..."
loadproc /usr/sbin/unbound || exit $?
+ # Make own hostname resolveable
+ own_hostname
+
# Update any known forwarding name servers
update_forwarders
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-10-03 15:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-03 15:58 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9aa7b0469da00d4ba745b682f0c5874ffa8ac92d git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox