Skip to content
Snippets Groups Projects
Commit aecde48e authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Merge branch 'master' into bulk_updates

parents c4f8c012 26cf97e4
No related branches found
No related tags found
No related merge requests found
......@@ -51,13 +51,13 @@ If you want to control the daemon directly, use ``SIGINT`` to quit the process o
Actions:
stop Stop server.
reload Reload configuration and changed zones.
refresh [zone] Refresh slave zone (all if not specified).
refresh <zone> Refresh slave zone (all if not specified).
flush Flush journal and update zone files.
status Check if server is running.
zonestatus Show status of configured zones.
checkconf Check current server configuration.
checkzone [zone] Check zone (all if not specified).
memstats [zone] Estimate memory consumption for zone (all if not
checkzone <zone> Check zone (all if not specified).
memstats <zone> Estimate memory consumption for zone (all if not
specified).
Also, the server needs to create several files in order to run properly. These
......
......@@ -80,14 +80,14 @@ static int cmd_signzone(int argc, char *argv[], unsigned flags);
knot_cmd_t knot_cmd_tbl[] = {
{&cmd_stop, 0, "stop", "", "\t\tStop server."},
{&cmd_reload, 0, "reload", "", "\tReload configuration and changed zones."},
{&cmd_refresh, 0, "refresh", "[zone]", "\tRefresh slave zone (all if not specified). Flag '-f' forces retransfer."},
{&cmd_refresh, 0, "refresh", "<zone>", "\tRefresh slave zone (all if not specified). Flag '-f' forces retransfer."},
{&cmd_flush, 0, "flush", "", "\t\tFlush journal and update zone files."},
{&cmd_status, 0, "status", "", "\tCheck if server is running."},
{&cmd_zonestatus, 0, "zonestatus", "", "\tShow status of configured zones."},
{&cmd_checkconf, 1, "checkconf", "", "\tCheck current server configuration."},
{&cmd_checkzone, 1, "checkzone", "[zone]", "Check zone (all if not specified)."},
{&cmd_memstats, 1, "memstats", "[zone]", "Estimate memory use for zone (all if not specified)."},
{&cmd_signzone, 0, "signzone", "[zone]", "Sign all zones with available DNSSEC keys."},
{&cmd_checkzone, 1, "checkzone", "<zone>", "Check zone (all if not specified)."},
{&cmd_memstats, 1, "memstats", "<zone>", "Estimate memory use for zone (all if not specified)."},
{&cmd_signzone, 0, "signzone", "<zone>", "Sign all zones with available DNSSEC keys."},
{NULL, 0, NULL, NULL, NULL}
};
......
#!/usr/bin/env python3
'''Test for EDNS version'''
from dnstest.test import Test
t = Test()
server = t.server("knot")
zone = t.zone("example.com.")
t.link(zone, server)
t.start()
# Supported EDNS version 0.
resp = server.dig("example.com", "SOA", edns=0)
resp.check(rcode="NOERROR")
# Unsupported EDNS version 1.
resp = server.dig("example.com", "SOA", edns=1)
resp.check(rcode="BADVERS")
t.end()
......@@ -393,7 +393,7 @@ class Server(object):
f.close
def dig(self, rname, rtype, rclass="IN", udp=None, serial=None,
timeout=None, tries=3, flags="", bufsize=None,
timeout=None, tries=3, flags="", bufsize=None, edns=None,
nsid=False, dnssec=False, log_no_sep=False):
key_params = self.tsig_test.key_params if self.tsig_test else dict()
......@@ -458,7 +458,7 @@ class Server(object):
dig_flags += " +cd"
# Set EDNS.
if nsid or bufsize:
if edns != None or bufsize or nsid:
class NsidFix(object):
'''Current pythondns doesn't implement NSID option.'''
def __init__(self):
......@@ -466,6 +466,12 @@ class Server(object):
def to_wire(self, file=None):
pass
if edns:
edns = int(edns)
else:
edns = 0
dig_flags += " +edns=%i" % edns
if bufsize:
payload = int(bufsize)
else:
......@@ -478,7 +484,7 @@ class Server(object):
else:
options = None
query.use_edns(edns=0, payload=payload, options=options)
query.use_edns(edns=edns, payload=payload, options=options)
# Set DO flag.
if dnssec:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment