diff --git a/data/templates/dns-forwarding/recursor.conf.tmpl b/data/templates/dns-forwarding/recursor.conf.tmpl
index 8799718b..98560efa 100644
--- a/data/templates/dns-forwarding/recursor.conf.tmpl
+++ b/data/templates/dns-forwarding/recursor.conf.tmpl
@@ -29,5 +29,20 @@ local-address={{ listen_address | join(',') }}
 # dnssec
 dnssec={{ dnssec }}
 
+# max-ttl
+max-cache-ttl={{ advanced.max_ttl }}
+
+# pdns-option
+{% for o in advanced.pdns_option %}
+{{ o }}
+
+{% endfor %}
+
+# port
+local-port={{ advanced.port }}
+
+# zones
+auth-zones={% for z in zones %}{{ z.name }}={{ z.file }}{{- "," if not loop.last -}}{% endfor %}
+
 forward-zones-file=recursor.forward-zones.conf
 
diff --git a/data/templates/dns-forwarding/recursor.zone.conf.tmpl b/data/templates/dns-forwarding/recursor.zone.conf.tmpl
new file mode 100644
index 00000000..c46787ed
--- /dev/null
+++ b/data/templates/dns-forwarding/recursor.zone.conf.tmpl
@@ -0,0 +1,8 @@
+;
+; Autogenerated by dns_forwarding.py
+;
+                                                                                                                                                                                            ;
+{% for r in records %}
+{{ r.name }}    {{ r.type }}    {{ r.preference }} {{ r.target }}
+{% endfor %}
+
diff --git a/interface-definitions/dns-forwarding.xml.in b/interface-definitions/dns-forwarding.xml.in
index 66b4db40..a4adbe98 100644
--- a/interface-definitions/dns-forwarding.xml.in
+++ b/interface-definitions/dns-forwarding.xml.in
@@ -182,6 +182,188 @@
                 </properties>
                 <defaultValue>0.0.0.0 ::</defaultValue>
               </leafNode>
+              <node name="advanced">
+                <properties>
+                  <help>Set advanced settings and DNS manipulations</help>
+                </properties>
+                <children>
+                  <leafNode name="max-ttl">
+                    <properties>
+                      <help>Maximum amount of time requesting clients are allowed to cache replies</help>
+                      <valueHelp>
+                        <format>u32:0-604800</format>
+                        <description>Seconds to cache records</description>
+                      </valueHelp>
+                      <constraint>
+                        <validator name="numeric" argument="--range 0-60400"/>
+                      </constraint>
+                    </properties>
+                    <defaultValue>86400</defaultValue>
+                  </leafNode>
+                  <leafNode name="pdns-option">
+                    <properties>
+                      <help>Specify pdns-recursor configuration command to be added directly to the config file</help>
+                      <valueHelp>
+                        <format>text</format>
+                        <description>setting command in pdns-recursor format</description>
+                      </valueHelp>
+                      <multi/>
+                    </properties>
+                  </leafNode>
+                  <leafNode name="port">
+                    <properties>
+                      <help>Set different listening port</help>
+                      <valueHelp>
+                        <format>u32:1-65535</format>
+                        <description>Port to listen on</description>
+                      </valueHelp>
+                      <constraint>
+                        <validator name="numeric" argument="--range 1-65535"/>
+                      </constraint>
+                    </properties>
+                    <defaultValue>53</defaultValue>
+                  </leafNode>
+                  <tagNode name="zone">
+                    <properties>
+                      <help>Set domain name to create/manipulate DNS zone for</help>
+                    </properties>
+                    <children>
+                      <tagNode name="A">
+                        <properties>
+                          <help>Set A record name</help>
+                        </properties>
+                        <children>
+                          <leafNode name="address">
+                            <properties>
+                              <help>Set IP address to be returned for specified domain</help>
+                              <valueHelp>
+                                <format>ipv4</format>
+                                <description>Record IPv4 address</description>
+                              </valueHelp>
+                              <multi/>
+                              <constraint>
+                                <validator name="ipv4-address"/>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                          #include <include/generic-disable-node.xml.i>
+                        </children>
+                      </tagNode>
+                      <tagNode name="AAAA">
+                        <properties>
+                          <help>Set AAAA record name</help>
+                        </properties>
+                        <children>
+                          <leafNode name="address">
+                            <properties>
+                              <help>Set IP address to be returned for specified domain</help>
+                              <valueHelp>
+                                <format>ipv6</format>
+                                <description>Record IPv6 address</description>
+                              </valueHelp>
+                              <multi/>
+                              <constraint>
+                                <validator name="ipv6-address"/>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                          #include <include/generic-disable-node.xml.i>
+                        </children>
+                      </tagNode>
+                      <tagNode name="CNAME">
+                        <properties>
+                          <help>Set CNAME record name</help>
+                        </properties>
+                        <children>
+                          #include <include/generic-disable-node.xml.i>
+                          <leafNode name="hostname">
+                            <properties>
+                              <help>Set CNAME record target name</help>
+                              <valueHelp>
+                                <format>text</format>
+                                <description>Record target name</description>
+                              </valueHelp>
+                              <constraint>
+                                <regex>^[-a-zA-Z0-9.]{0,63}$</regex>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                        </children>
+                      </tagNode>
+                      <tagNode name="MX">
+                        <properties>
+                          <help>Set MX record name</help>
+                        </properties>
+                        <children>
+                          #include <include/generic-disable-node.xml.i>
+                          <leafNode name="hostname">
+                            <properties>
+                              <help>Set MX destination hostname</help>
+                              <valueHelp>
+                                <format>text</format>
+                                <description>Record destination hostname</description>
+                              </valueHelp>
+                              <constraint>
+                                <regex>^[-a-zA-Z0-9.]{0,63}$</regex>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                          <leafNode name="preference">
+                            <properties>
+                              <help>Set preference for MX record</help>
+                              <valueHelp>
+                                <format>1-999</format>
+                                <description>Preference for MX record</description>
+                              </valueHelp>
+                              <constraint>
+                                <validator name="numeric" argument="--range 1-999"/>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                        </children>
+                      </tagNode>
+                      <tagNode name="PTR">
+                        <properties>
+                          <help>Set PTR record name</help>
+                        </properties>
+                        <children>
+                          #include <include/generic-disable-node.xml.i>
+                          <leafNode name="hostname">
+                            <properties>
+                              <help>Set PTR record target</help>
+                              <valueHelp>
+                                <format>text</format>
+                                <description>Record target name</description>
+                              </valueHelp>
+                              <constraint>
+                                <regex>^[-a-zA-Z0-9.]{0,63}$</regex>
+                              </constraint>
+                            </properties>
+                          </leafNode>
+                        </children>
+                      </tagNode>
+                      <tagNode name="TXT">
+                        <properties>
+                          <help>Set TXT record name</help>
+                        </properties>
+                        <children>
+                          #include <include/generic-disable-node.xml.i>
+                          <leafNode name="text">
+                            <properties>
+                              <help>Set TXT record text content</help>
+                              <valueHelp>
+                                <format>text</format>
+                                <description>Record text content</description>
+                              </valueHelp>
+                            </properties>
+                          </leafNode>
+                        </children>
+                      </tagNode>
+                      #include <include/generic-disable-node.xml.i>
+                    </children>
+                  </tagNode>
+                </children>
+              </node>
               <leafNode name="system">
                 <properties>
                   <help>Use system name servers</help>
diff --git a/src/conf_mode/dns_forwarding.py b/src/conf_mode/dns_forwarding.py
index c21a91a..355d063 100755
--- a/src/conf_mode/dns_forwarding.py
+++ b/src/conf_mode/dns_forwarding.py
@@ -81,6 +84,49 @@ def get_config(config=None):
     dns.update({'source_address_v4': source_address_v4})
     dns.update({'source_address_v6': source_address_v6})
 
+    advanced = dns.get('advanced', {})
+    if 'pdns_option' not in advanced:
+        dns['advanced']['pdns_option'] = []
+    dns['zones'] = []
+    if 'zone' in advanced:
+        for node in advanced['zone']:
+            zonedata = advanced['zone'][node]
+            if 'disable' in zonedata:
+                continue
+            zone = {
+                'name': node,
+                'file': "{}/zone.{}.conf".format(pdns_rec_run_dir, node),
+                'records': [],
+            }
+            for rtype in [ 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'TXT' ]:
+                if rtype not in zonedata:
+                    continue
+                for subnode in zonedata[rtype]:
+                    if 'disable' in zonedata[rtype][subnode]:
+                        continue
+                    preference = '10'
+                    if 'preference' in zonedata[rtype][subnode]:
+                        preference = zonedata[rtype][subnode]['preference']
+                    target = 'hostname'
+                    if rtype in [ 'A', 'AAAA' ]:
+                        target = 'address'
+                    if rtype == 'TXT':
+                        target = 'text'
+                    if target not in zonedata[rtype][subnode]:
+                        continue
+                    targetdata = zonedata[rtype][subnode][target] if rtype in [ 'A', 'AAAA' ] else [ zonedata[rtype][subnode][target] ]
+                    for item in targetdata:
+                        if rtype == 'TXT':
+                            item = "\"{}\"".format(item.replace("\"", "\\\""))
+                        record = {
+                            'name': subnode,
+                            'type': rtype,
+                            'preference': preference if rtype == 'MX' else '',
+                            'target': item,
+                        }
+                        zone['records'].append(record)
+            dns['zones'].append(zone)
+
     return dns
 
 def verify(dns):
@@ -119,6 +166,10 @@ def generate(dns):
     render(pdns_rec_lua_conf_file, 'dns-forwarding/recursor.conf.lua.tmpl',
             dns, user=pdns_rec_user, group=pdns_rec_group)
 
+    for zone in dns['zones']:
+        render(zone['file'], 'dns-forwarding/recursor.zone.conf.tmpl',
+            zone, user=pdns_rec_user, group=pdns_rec_group)
+
     # if vyos-hostsd didn't create its files yet, create them (empty)
     for file in [pdns_rec_hostsd_lua_conf_file, pdns_rec_hostsd_zones_file]:
         with open(file, 'a'):
