ansible.builtin.win_dns_record (v2.9.27) — module

Manage Windows Server DNS records

| "added in version" 2.8 of ansible.builtin"

Authors: John Nelson (@johnboy2)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Manage DNS records within an existing Windows Server DNS zone.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create database server alias
  win_dns_record:
    name: "db1"
    type: "CNAME"
    value: "cgyl1404p.amer.example.com"
    zone: "amer.example.com"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: PTR example
  win_dns_record:
    name: "1.1.1"
    type: "PTR"
    value: "db1"
    zone: "10.in-addr.arpa"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove static record
  win_dns_record:
    name: "db1"
    type: "A"
    state: absent
    zone: "amer.example.com"

Inputs

    
ttl:
    default: 3600
    description:
    - The "time to live" of the record, in seconds.
    - Ignored when C(state=absent).
    - Valid range is 1 - 31557600.
    - Note that an Active Directory forest can specify a minimum TTL, and will dynamically
      "round up" other values to that minimum.
    type: int

name:
    description:
    - The name of the record.
    required: true
    type: str

type:
    choices:
    - A
    - AAAA
    - CNAME
    - PTR
    description:
    - The type of DNS record to manage.
    required: true
    type: str

zone:
    description:
    - The name of the zone to manage (eg C(example.com)).
    - The zone must already exist.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the record should exist or not.
    type: str

value:
    aliases:
    - values
    description:
    - The value(s) to specify. Required when C(state=present).
    - When c(type=PTR) only the partial part of the IP should be given.
    type: list

computer_name:
    description:
    - Specifies a DNS server.
    - You can specify an IP address or any value that resolves to an IP address, such
      as a fully qualified domain name (FQDN), host name, or NETBIOS name.
    type: str