[vpn] DNS-Server

Bernd Kalbfuss-Zimmermann kalbfuss at gmx.net
Sa Aug 23 21:36:45 CEST 2014


Hallo Bodems,

feine Sache! Habe meine dnsmasq-Konfiguration bereits angepasst. Namensauflösung anderer Freifunk-Domains scheint einwandfrei zu funktionieren. Mittels einer Pull-Anfrage auf github.com habe ich außerdem die Konfiguration für die TLD "ff3l" der Gemeinde Dreiländereck hinzugefügt. 
Um die Aktualisierung der DNS-Server zu automatisieren, habe ich mir einen Wrapper für das Skript "genconfig.py" gebaut (siehe unten). Das Skript "genconfig.py" ist super! Den Namen finde ich allerdings nicht so gelungen. Er könnte etwas spezifischer sein. 

LG,

Bernd

--

#!/bin/bash             
# Simple script to update dnsmasq rules for Freifunk DNS servers
# configured in ffdns git repository.

# Path to git clone of ffdns repository
FFDN=/etc/ffdns
# Path DNS server configuration files
FFDN_DATA=$FFDN/data
# Path to output file for generated dnsmasq rules
DNSMASQ_CONF=/etc/dnsmasq.d/ffdns
# Path to genconfig.py script delivered with ffdns repository. For security 
# reasons the script should be copied to a safe location and not executed
# from within the repository.
GENCONFIG=/usr/local/bin/genconfig.py
# Comma separated list of genconfig configuration files to be excluded.
# Typically you would want to exclude the configuration file for your own domain. 
GENCONFIG_EXCLUDE=ff3l

function getCurrentVersion() {
 # Get hash from latest revision
 git log --format=format:%H -1
}

cd $FFDN

# Get current version hash
GIT_REVISION=$(getCurrentVersion)                

# Automagically commit local changes
# This preserves local changes
git commit -m "CRON: auto commit"

# Pull latest changes from upstream
git fetch                                                                
git merge origin/master -m "Auto Merge"

# Get new version hash
GIT_NEW_REVISION=$(getCurrentVersion)                

# Check whether version has changed and we need to update dnsmasq configuration
if [ $GIT_REVISION != $GIT_NEW_REVISION ]
then                                                              
 echo "Recreate dnsmasq rules for Freifunk DNS servers"
 (su -p -c "$GENCONFIG -f dnsmasq -s $FFDN_DATA -x $GENCONFIG_EXCLUDE" nobody) > $DNSMASQ_CONF

 echo "Reload dnsmasq configuratio"
 kill -HUP $(pidof dnsmasq)
fi

-----Ursprüngliche Nachricht-----
Von: vpn [mailto:vpn-bounces at freifunk.net] Im Auftrag von bodems
Gesendet: Freitag, 22. August 2014 23:17
An: vpn at freifunk.net
Betreff: Re: [vpn] DNS-Server

Hallo,
die Hamburger sammeln in einem Githubrepo DNS-Server, mit denen man sich dann automatisch configs für dnsmasq und bind generieren lassen kann:
https://github.com/freifunkhamburg/ffdns

bodems



Mehr Informationen über die Mailingliste vpn