├── README.md └── pdnsd ├── Makefile └── files └── pdnsd.init /README.md: -------------------------------------------------------------------------------- 1 | Add this line to your feeds.conf.default. 2 | 3 | 4 | `src-git openwrtpdnsd https://github.com/mengskysama/openwrt-pdnsd.git` 5 | 6 | And run: 7 | 8 | 9 | `./scripts/feeds update -a && ./scripts/feeds install -a` 10 | -------------------------------------------------------------------------------- /pdnsd/Makefile: -------------------------------------------------------------------------------- 1 | include $(TOPDIR)/rules.mk 2 | 3 | PKG_NAME:=pdnsd 4 | PKG_VERSION:=1.2.9 5 | PKG_RELEASE=$(PKG_SOURCE_VERSION) 6 | 7 | PKG_SOURCE_PROTO:=git 8 | PKG_SOURCE_URL:=https://github.com/mengskysama/pdnsd.git 9 | PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) 10 | PKG_SOURCE_VERSION:=e02a81d9e63927e93dc49d218535c880623bcd77 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz 12 | # PKG_MIRROR_MD5SUM:= 13 | # CMAKE_INSTALL:=1 14 | 15 | include $(INCLUDE_DIR)/package.mk 16 | 17 | define Package/pdnsd 18 | SECTION:=net 19 | CATEGORY:=Network 20 | SUBMENU:=Web Servers/Proxies 21 | DEPENDS:=+libpthread 22 | TITLE:=Proxy DNS Server 23 | endef 24 | 25 | define Package/pdnsd/description 26 | pdnsd, is an IPv6 capable proxy DNS server with permanent caching (the cache 27 | contents are written to hard disk on exit) that is designed to cope with 28 | unreachable or down DNS servers (for example in dial-in networking). 29 | 30 | pdnsd can be used with applications that do dns lookups, eg on startup, and 31 | can't be configured to change that behaviour, to prevent the often 32 | minute-long hangs (or even crashes) that result from stalled dns queries. 33 | endef 34 | 35 | TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include 36 | #TARGET_CFLAGS += -ggdb3 37 | 38 | CMAKE_OPTIONS += -DDEBUG=1 39 | 40 | CONFIGURE_ARGS += \ 41 | --with-cachedir=/var/pdnsd 42 | 43 | define Package/pdnsd/install 44 | $(INSTALL_DIR) $(1)/usr/sbin 45 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pdnsd $(1)/usr/sbin/ 46 | $(INSTALL_DIR) $(1)/usr/bin 47 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pdnsd-ctl/pdnsd-ctl $(1)/usr/bin/ 48 | 49 | $(INSTALL_DIR) $(1)/etc/init.d 50 | $(INSTALL_BIN) ./files/pdnsd.init $(1)/etc/init.d/pdnsd 51 | $(INSTALL_DIR) $(1)/etc 52 | $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/pdnsd.conf $(1)/etc/ 53 | endef 54 | 55 | $(eval $(call BuildPackage,pdnsd)) 56 | -------------------------------------------------------------------------------- /pdnsd/files/pdnsd.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=65 4 | NAME=pdnsd 5 | DESC="proxy DNS server" 6 | 7 | DAEMON=/usr/sbin/pdnsd 8 | PID_FILE=/var/run/$NAME.pid 9 | CACHEDIR=/var/pdnsd 10 | CACHE=$CACHEDIR/pdnsd.cache 11 | 12 | USER=nobody 13 | GROUP=nogroup 14 | 15 | start() { 16 | echo -n "Starting $DESC: $NAME" 17 | 18 | gen_cache 19 | 20 | $DAEMON --daemon -p $PID_FILE 21 | echo " ." 22 | } 23 | 24 | stop() { 25 | echo -n "Stopping $DESC: $NAME" 26 | kill `cat $PID_FILE` > /dev/null 2>&1 27 | rm -rf $PID_FILE 28 | echo " ." 29 | } 30 | 31 | restart() { 32 | echo "Restarting $DESC: $NAME... " 33 | stop 34 | sleep 2 35 | start 36 | } 37 | 38 | gen_cache() 39 | { 40 | if ! test -f "$CACHE"; then 41 | mkdir -p `dirname $CACHE` 42 | dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null 43 | chown -R $USER.$GROUP $CACHEDIR 44 | fi 45 | } 46 | 47 | --------------------------------------------------------------------------------