2020-12-29 05:07:33 +08:00
|
|
|
This provider updates a Microsoft DNS server.
|
|
|
|
|
|
|
|
It interacts with the server via PowerShell commands. As a result, DNSControl
|
|
|
|
must be run on Windows and will automatically disable itself when run on
|
|
|
|
non-Windows systems.
|
|
|
|
|
|
|
|
DNSControl will use `New-PSSession` to execute the commands remotely if
|
|
|
|
`computername` is set in `creds.json` (see below).
|
|
|
|
|
|
|
|
# Caveats
|
|
|
|
|
|
|
|
* Two systems updating a zone is never a good idea. If Windows Dynamic
|
|
|
|
DNS and DNSControl are both updating a zone, there will be
|
|
|
|
unhappiness. DNSControl will blindly remove the dynamic records
|
|
|
|
unless precautions such as `IGNORE*` and `NO_PURGE` are in use.
|
|
|
|
|
|
|
|
# Running on Non-Windows systems
|
|
|
|
|
|
|
|
Currently this driver disables itself when run on Non-Windows systems.
|
|
|
|
|
|
|
|
It should be possible for non-Windows hosts with PowerShell Core installed to
|
|
|
|
execute commands remotely via SSH. The module used to talk to PowerShell
|
|
|
|
supports this. It should be easy to implement. Volunteers requested.
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2022-05-09 02:41:33 +08:00
|
|
|
To use this provider, add an entry to `creds.json` with `TYPE` set to `MSDNS`
|
|
|
|
along with other settings:
|
|
|
|
|
|
|
|
* `dnsserver`: (optional) the name of the Microsoft DNS Server to communicate with.
|
2023-04-14 01:38:39 +08:00
|
|
|
* `psusername`: (optional) the username to connect to the PowerShell PSSession host.
|
|
|
|
* `pspassword`: (optional) the password to connect to the PowerShell PSSession host.
|
2022-05-09 02:41:33 +08:00
|
|
|
|
|
|
|
Example:
|
2020-12-29 05:07:33 +08:00
|
|
|
|
2023-03-03 05:17:27 +08:00
|
|
|
{% code title="creds.json" %}
|
2022-02-18 01:22:31 +08:00
|
|
|
```json
|
2020-12-29 05:07:33 +08:00
|
|
|
{
|
|
|
|
"msdns": {
|
2022-05-09 02:41:33 +08:00
|
|
|
"TYPE": "MSDNS",
|
2020-12-29 05:07:33 +08:00
|
|
|
"dnsserver": "ny-dc01",
|
2023-04-14 01:38:39 +08:00
|
|
|
"psusername": "mywindowsusername",
|
|
|
|
"pspassword": "mysupersecurepassword"
|
2020-12-29 05:07:33 +08:00
|
|
|
}
|
|
|
|
}
|
2022-02-18 01:22:31 +08:00
|
|
|
```
|
2023-03-03 05:17:27 +08:00
|
|
|
{% endcode %}
|
2020-12-29 05:07:33 +08:00
|
|
|
|
|
|
|
An example DNS configuration:
|
|
|
|
|
2023-03-11 21:42:01 +08:00
|
|
|
{% code title="dnsconfig.js" %}
|
2023-01-20 20:56:20 +08:00
|
|
|
```javascript
|
2022-05-09 02:41:33 +08:00
|
|
|
var REG_NONE = NewRegistrar("none");
|
|
|
|
var DSP_MSDNS = NewDnsProvider("msdns");
|
2020-12-29 05:07:33 +08:00
|
|
|
|
2023-06-17 20:58:17 +08:00
|
|
|
D("example.com", REG_NONE, DnsProvider(DSP_MSDNS),
|
2024-05-13 20:47:23 +08:00
|
|
|
A("test", "1.2.3.4"),
|
|
|
|
END)
|
2022-02-18 01:22:31 +08:00
|
|
|
```
|
2023-03-11 21:42:01 +08:00
|
|
|
{% endcode %}
|