Managing Views
==============

Views are a feature of PowerDNS Authoritative Server v5.
An introduction to views and instructions on enabling the feature are covered
in relevant documentation_.

.. _documentation: https://doc.powerdns.com/authoritative/views.html

Zone Variants
-------------

Zone variants are technically independent zones sharing the same zone name but
differing in their variant names.
They are identified by variant name labels appearing to the right of a zone
name, where applicable.

Adding Zone Variants
''''''''''''''''''''

Adding a zone variant is no different from adding any zone, except that a
variant name should be specified when doing so.

Associating Zone Variants With Views
''''''''''''''''''''''''''''''''''''

There are two ways to associate a zone variant with a view.

From the zone details page:

#. Click on the "Views" button to reveal a dropdown menu
#. Click on "Associate with view" under the dropdown
#. Enter/Select the desired view name
#. Press the "Associate" button

From the Views tab in the main window:

#. Press the "Associate zone variant" button
#. Select/Search for the relevant zone variant
#. Enter/Select the desired view name
#. Press the "Associate" button

Dissociating Zone Variants From Views
'''''''''''''''''''''''''''''''''''''

To dissociate a zone variant from a view,

#. Navigate to the Views tab in the main window
#. Scroll to the table row representing the relevant view
#. Click on the caret appearing to the right of the zone variant to reveal a
   dropdown menu
#. Click on "Dissociate zone variant from view" under the dropdown

Networks
--------

A network is a block of IPv4/v6 addresses in CIDR notation.
A view signifies a many-to-many relationship between associated zone variants
and networks.
The Networks tab in the main window presents a sorted and filterable list of
networks associated with views.

Associating Networks With Views
'''''''''''''''''''''''''''''''

To associate a network with a view,

#. Navigate to the Views tab in the main window
#. Scroll to the table row representing the relevant view
#. Enter the desired network in the input field under the "Networks" column
#. Press the button labelled with a plus (+) icon attached to the input field

Dissociating Networks From Views
''''''''''''''''''''''''''''''''

To dissociate a network from a view,

#. Navigate to the Views tab in the main window
#. Scroll to the table row representing the relevant view
#. Click on the network to reveal a dropdown menu
#. Click on "Dissociate network from view" under the dropdown
