From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 9aa7b0469da00d4ba745b682f0c5874ffa8ac92d
Date: Mon, 03 Oct 2016 16:58:20 +0100 [thread overview]
Message-ID: <20161003155821.75D361078E81@git01.ipfire.org> (raw)
[-- 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
reply other threads:[~2016-10-03 15:58 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161003155821.75D361078E81@git01.ipfire.org \
--to=git@ipfire.org \
--cc=ipfire-scm@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox