CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \
./configure \
--enable-option-checking=fatal \
- --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+ --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
--enable-systemd \
--enable-tools \
--enable-unit-tests \
./configure \
--enable-option-checking=fatal \
--disable-systemd \
- --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc random tinydns' \
+ --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc tinydns' \
--enable-tools \
--with-lmdb=/usr \
--with-libsodium \
if: matrix.product == 'auth'
run: |
autoreconf -vfi
- ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
+ ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
make -j8 -C ext
make -j8 -C modules
make -j8 -C pdns
--with-lua=${LUAVER} \
--sysconfdir=/etc/powerdns \
--enable-option-checking=fatal \
- --with-dynmodules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+ --with-dynmodules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
--enable-tools \
--enable-ixfrdist \
--with-unixodbc-lib=/usr/lib/$(dpkg-architecture -q DEB_BUILD_GNU_TYPE) && \
usr/bin/pdnsutil
usr/bin/zone2json
usr/bin/zone2sql
-usr/lib/*/pdns/librandombackend.so*
usr/sbin/pdns_server
export PDNS_TEST_NO_IPV6=1
# Backends
-backends := bind ldap lmdb lua2 pipe gmysql godbc gpgsql gsqlite3 geoip remote random tinydns
+backends := bind ldap lmdb lua2 pipe gmysql godbc gpgsql gsqlite3 geoip remote tinydns
%:
--disable-silent-rules \
--with-modules='' \
--with-lua=%{lua_implementation} \
- --with-dynmodules='%{backends} random' \
+ --with-dynmodules='%{backends}' \
--enable-tools \
--with-libsodium \
%if 0%{?amzn} != 2
%{_bindir}/zone2json
%{_bindir}/zone2sql
%{_libdir}/%{name}/libbindbackend.so
-%{_libdir}/%{name}/librandombackend.so
%{_mandir}/man1/pdns-zone2ldap.1.gz
%{_mandir}/man1/pdns_control.1.gz
%{_mandir}/man1/pdns_server.1.gz
[socketdir="$withval"]
)
-modules="bind gmysql random"
+modules="bind gmysql"
AC_ARG_WITH([modules],
- [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])],
+ [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql@:>@])],
[modules="$withval"]
)
modules/lmdbbackend/Makefile
modules/lua2backend/Makefile
modules/pipebackend/Makefile
- modules/randombackend/Makefile
modules/remotebackend/Makefile
modules/tinydnsbackend/Makefile
])
simple C++ trick which makes sure that this function is called on
execution of the binary or when loading the dynamic module.
-Please note that a RandomBackend is actually in most PowerDNS releases.
-By default it lives on random.example.com, but you can change that by
-setting :ref:`setting-random-hostname`.
-
.. note::
This simple backend neglects to handle case properly!
Random Backend
==============
+.. deprecated:: 4.6.0
+ This backend has been removed in 4.6.0
+
- Native: Yes
- Master: No
- Slave: No
lmdbbackend \
lua2backend \
pipebackend \
- randombackend \
remotebackend \
tinydnsbackend
+++ /dev/null
-pkglib_LTLIBRARIES = librandombackend.la
-
-EXTRA_DIST = OBJECTFILES OBJECTLIBS
-
-librandombackend_la_SOURCES = randombackend.cc
-librandombackend_la_LDFLAGS = -module -avoid-version
+++ /dev/null
-randombackend.lo
+++ /dev/null
-/*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "pdns/dnsbackend.hh"
-#include "pdns/dns.hh"
-#include "pdns/dnsbackend.hh"
-#include "pdns/dnspacket.hh"
-#include "pdns/dns_random.hh"
-#include "pdns/pdnsexception.hh"
-#include "pdns/logger.hh"
-#include "pdns/version.hh"
-#include <boost/algorithm/string.hpp>
-
-/* FIRST PART */
-class RandomBackend : public DNSBackend
-{
-public:
- RandomBackend(const string& suffix = "")
- {
- setArgPrefix("random" + suffix);
- d_ourname = DNSName(getArg("hostname"));
- d_ourdomain = d_ourname;
- d_ourdomain.chopOff();
- }
-
- bool list(const DNSName& target, int id, bool include_disabled) override
- {
- return false; // we don't support AXFR
- }
-
- void lookup(const QType& type, const DNSName& qdomain, int zoneId, DNSPacket* p) override
- {
- if (qdomain == d_ourdomain) {
- if (type.getCode() == QType::SOA || type.getCode() == QType::ANY) {
- d_answer = "ns1." + d_ourdomain.toString() + " hostmaster." + d_ourdomain.toString() + " 1234567890 86400 7200 604800 300";
- }
- else {
- d_answer.clear();
- ;
- }
- }
- else if (qdomain == d_ourname) {
- if (type.getCode() == QType::A || type.getCode() == QType::ANY) {
- ostringstream os;
- os << dns_random(256) << "." << dns_random(256) << "." << dns_random(256) << "." << dns_random(256);
- d_answer = os.str(); // our random ip address
- }
- else {
- d_answer = "";
- }
- }
- else {
- d_answer = "";
- }
- }
-
- bool get(DNSResourceRecord& rr) override
- {
- if (d_answer.empty())
- return false;
-
- if (d_answer.find("ns1.") == 0) {
- rr.qname = d_ourdomain;
- rr.qtype = QType::SOA;
- }
- else {
- rr.qname = d_ourname;
- rr.qtype = QType::A;
- }
- rr.qclass = QClass::IN; // Internet class randomness.
- rr.ttl = 5; // 5 seconds
- rr.auth = true; // it may be random.. but it is auth!
- rr.content = d_answer;
-
- d_answer.clear(); // this was the last answer
- return true;
- }
-
-private:
- string d_answer;
- DNSName d_ourname;
- DNSName d_ourdomain;
-};
-
-/* SECOND PART */
-
-class RandomFactory : public BackendFactory
-{
-public:
- RandomFactory() :
- BackendFactory("random") {}
- void declareArguments(const string& suffix = "") override
- {
- declare(suffix, "hostname", "Hostname which is to be random", "random.example.com");
- }
- DNSBackend* make(const string& suffix = "") override
- {
- return new RandomBackend(suffix);
- }
-};
-
-/* THIRD PART */
-
-class RandomLoader
-{
-public:
- RandomLoader()
- {
- BackendMakers().report(new RandomFactory);
- g_log << Logger::Info << "[randombackend] This is the random backend version " VERSION
-#ifndef REPRODUCIBLE
- << " (" __DATE__ " " __TIME__ ")"
-#endif
- << " reporting" << endl;
- }
-};
-
-static RandomLoader randomLoader;
rm -f pdns*.pid
$PDNS --daemon=no --local-address=127.0.0.1,::1 \
- --local-port=$port --socket-dir=./ --no-shuffle --launch=random --no-config \
- --module-dir=../regression-tests/modules --zone-cache-refresh-interval=0 &
+ --local-port=$port --socket-dir=./ --no-shuffle --launch=bind --no-config \
+ --module-dir=../regression-tests/modules --bind-config=counters/named.conf &
sleep 2
-$SDIG 127.0.0.1 $port random.example.com A >&2 >/dev/null
-$SDIG 127.0.0.1 $port example.com SOA >&2 >/dev/null
+$SDIG 127.0.0.1 $port server1.test.com A >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SOA >&2 >/dev/null
-$SDIG 127.0.0.1 $port random.example.com A tcp >&2 >/dev/null
-$SDIG 127.0.0.1 $port example.com SOA tcp >&2 >/dev/null
+$SDIG 127.0.0.1 $port server1.test.com A tcp >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SOA tcp >&2 >/dev/null
-$SDIG ::1 $port random.example.com A >&2 >/dev/null
-$SDIG ::1 $port random.example.com A tcp >&2 >/dev/null
+$SDIG ::1 $port server1.test.com A >&2 >/dev/null
+$SDIG ::1 $port server1.com A tcp >&2 >/dev/null
-$SDIG ::1 $port example.com SOA >&2 >/dev/null
-$SDIG ::1 $port example.com SOA tcp >&2 >/dev/null
+$SDIG ::1 $port test.com SOA >&2 >/dev/null
+$SDIG ::1 $port test.com SOA tcp >&2 >/dev/null
# NXDOMAIN
-$SDIG 127.0.0.1 $port nx.example.com A >&2 >/dev/null
+$SDIG 127.0.0.1 $port nx.test.com A >&2 >/dev/null
# NOERROR
-$SDIG 127.0.0.1 $port example.com SRV >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SRV >&2 >/dev/null
# unauth
-$SDIG 127.0.0.1 $port example.invalid MX >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com.invalid MX >&2 >/dev/null
$PDNSCONTROL --config-name= --no-config --socket-dir=./ 'show *' | \
tr ',' '\n'| grep -v -E '(user-msec|sys-msec|cpu-iowait|cpu-steal|uptime|udp-noport-errors|udp-in-errors|real-memory-usage|special-memory-usage|udp-recvbuf-errors|udp-sndbuf-errors|-hit|-miss|fd-usage|latency|backend-queries)' | LC_ALL=C sort
nxdomain-packets=1
open-tcp-connections=0
overload-drops=0
-packetcache-size=7
+packetcache-size=8
qsize-q=0
-query-cache-size=10
+query-cache-size=4
rd-queries=0
recursing-answers=0
recursing-questions=0
servfail-packets=0
signature-cache-size=0
signatures=0
-tcp-answers-bytes=264
+tcp-answers-bytes=235
tcp-answers=4
tcp-queries=4
-tcp4-answers-bytes=132
+tcp4-answers-bytes=128
tcp4-answers=2
tcp4-queries=2
-tcp6-answers-bytes=132
+tcp6-answers-bytes=107
tcp6-answers=2
tcp6-queries=2
timedout-packets=0
-udp-answers-bytes=460
+udp-answers-bytes=449
udp-answers=7
udp-do-queries=0
udp-queries=7
-udp4-answers-bytes=328
+udp4-answers-bytes=321
udp4-answers=5
udp4-queries=5
-udp6-answers-bytes=132
+udp6-answers-bytes=128
udp6-answers=2
udp6-queries=2
-unauth-packets=1
+unauth-packets=2
xfr-queue=0
-zone-cache-size=0
+zone-cache-size=1
--- /dev/null
+options {
+ directory "../regression-tests/zones/";
+ recursion no;
+ listen-on port 5300 {
+ 127.0.0.1;
+ };
+ version "Meow!Meow!";
+ minimal-responses yes;
+};
+
+zone "test.com"{
+ type master;
+ file "./test.com";
+};
CC='clang-11' \
CXX='clang++-11' \
--enable-option-checking=fatal \
- --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+ --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
--enable-systemd \
--enable-tools \
--enable-unit-tests \