##### SUMMARY

server parameter is required but not used as for zone resolution.

##### ISSUE TYPE

dns.resolver.zone_for_name is using system resolver so it can't be used to manage DNS entries from an external DNS without zone parameter. Zone resolution fails in this case.

The server parameter should be used as resolver.

##### COMPONENT NAME

nsupdate

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```ansible 2.7.5
  config file = /home/sylvain/.ansible.cfg
  configured module search path = [u'/usr/local/share/ansible']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.13 (default, Sep 26 2018, 18:42:22) [GCC 6.3.0 20170516]

```

##### CONFIGURATION

```
ANSIBLE_PIPELINING(/home/user/.ansible.cfg) = True
ANSIBLE_SSH_ARGS(/home/user/.ansible.cfg) = -o ControlMaster=auto -o ControlPersist=60m
ANSIBLE_SSH_CONTROL_PATH(/home/user/.ansible.cfg) = ~/.ssh/master-%%C
ANY_ERRORS_FATAL(/home/user/.ansible.cfg) = True
COLOR_DIFF_ADD(/home/user/.ansible.cfg) = yellow
COLOR_DIFF_LINES(/home/user/.ansible.cfg) = yellow
COLOR_DIFF_REMOVE(/home/user/.ansible.cfg) = yellow
DEFAULT_GATHERING(/home/user/.ansible.cfg) = smart
DEFAULT_GATHER_SUBSET(/home/user/.ansible.cfg) = min,network,hardware
DEFAULT_JINJA2_EXTENSIONS(/home/user/.ansible.cfg) = jinja2.ext.do
DEFAULT_SCP_IF_SSH(/home/user/.ansible.cfg) = True
DEFAULT_STDOUT_CALLBACK(/home/user/.ansible.cfg) = debug
DEFAULT_TIMEOUT(/home/user/.ansible.cfg) = 30
DIFF_ALWAYS(/home/user/.ansible.cfg) = True
INJECT_FACTS_AS_VARS(/home/user/.ansible.cfg) = False
INVENTORY_IGNORE_EXTS(/home/user/.ansible.cfg) = [u'.pyc', u'.pyo', u'.swp', u'.bak', u'.md', u'.txt', u'~', u'.orig', u'.ini', u'.cfg', u'.retry', u'.old', u'.dpkg-old', u'.dpkg-new']
PERSISTENT_CONTROL_PATH_DIR(/home/user/.ansible.cfg) = /home/user/.ansible/pc
RETRY_FILES_ENABLED(/home/user/.ansible.cfg) = False

```

##### OS / ENVIRONMENT

Debian 9.9


##### STEPS TO REPRODUCE

```
  - name: PTR entry
    nsupdate:
      key_name: "nsupdate"
      key_secret: "+bFQtBCta7j2vWkjPkAFtgA=="
      server: "10.0.0.1"
      record: "4.0.31.172.in-addr.arpa."
      type: "PTR"
      value: "server1.local."
```

This task failed :



##### EXPECTED RESULTS

Zone resolver should use server parameter : 10.0.0.1.


##### ACTUAL RESULTS

Exit with this error

```
Zone resolver error (NoNameservers): All nameservers failed to answer the query 4.0.31.172.in-addr.arpa. IN SOA: Server 127.0.0.1 UDP port 53 answered SERVFAIL
```

#
#
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}
DOCUMENTATION = '''
---
module: nsupdate
short_description: Manage DNS records.
description:
    - Create, update and remove DNS records using DDNS updates
version_added: "2.3"
requirements:
  - dnspython
author: "Loic Blot (@nerzhul)"
options:
    state:
        description:
            - Manage DNS record.
        choices: ['present', 'absent']
        default: 'present'