This Powershell module allows you to do some basic DNS operations on Aliyun DNS.
Including query, create, edit and remove any dns records on Aliyun DNS.
PS Version | Compatibility |
---|---|
5.1 | ✔️ |
5.0 | ✔️ |
4.0 | ✔️ |
3.0 | ✔️ |
2.0 | ❌ |
To use this module
- Copy the "AliyunDNS" folder to your PS module path.
Normally is%USERPROFILE%\Documents\WindowsPowershell\Modules\
- Edit the
config.json
file under the 'AliyunDNS' folder. Add theAccessKeyId
andAccessKeySecret
value to the file.
Note: You should get these two values from Aliyun Admin Panel or ask your DNS administrator. - Launch a Powershell window run as administrator.
- Execute the following powershell command to allow unsigned powershell scripts:
Set-ExecutionPolicy Unrestricted
Execute the folloing powershell command to start using the module and then have fun!:smile:
Import-Module AliyunDNS
Get-AliyunDNSRecord
[Mandatory]-Doamin <DomainName>
[Mandatory]-RecordId <RecordId>
[Mandatory]-SubDomain <SubDomainName>
-PageNumber <PageNo>
-PageSize <PageSize>
-Type <RecordType>
Note: You can only pass one of the mandatory parameters above.
New-AliyunDNSRecord
[Mandatory]-DomainName <DomainName>
[Mandatory]-RR <Host>
[Mandatory]-Type <RecordType>
[Mandatory]-Value <RecordValue>
-TTL <TTL>
-Priority <Priority>
-Line <Line>
Update-AliyunDNSRecord
[Mandatory]-RecordId <RecordId>
[Mandatory]-RR <Host>
[Mandatory]-Type <RecordType>
[Mandatory]-Value <RecordValue>
-TTL <TTL>
-Priority <Priority>
-Line <Line>
Set-AliyunDNSRecordStatus
[Mandatory]-RecordId <RecordId>
[Mandatory]-Status <Status>
Remove-AliyunDNSRecord
[Mandatory]-RecordId <RecordId>
Get-AliyunDomain
-DomainName <DomainName>
-WhoIs <$True|$False>
Get-AliyunDomain
-PageNumber <PageNumber>
-PageSize <PageSize>
Get-AliyunDomainLogs
-PageNumber <PageNumber>
-PageSize <PageSize>
-KeyWord <Keyword>
Get-MainDomain
-InputString <HostName>
For more information, please use help <Command>
阿里云DNS powershell模块用于进行基本的云解析操作,例如查询,新建,编辑,删除记录等
Powershell版本 | 兼容性 |
---|---|
5.1 | ✔️ |
5.0 | ✔️ |
4.0 | ✔️ |
3.0 | ✔️ |
2.0 | ❌ |
按照下面的步骤进行安装
- 拷贝AliyunDNS文件夹至powershell模块的默认路径。
通常为%USERPROFILE%\Documents\WindowsPowershell\Modules\
- 编辑AliyunDNS文件夹中的
config.json
文件。
添加AccessKeyId
和AccessKeySecret
的值。
注意: 你可以从阿里云的管理员中心获得这两个值,或者向你的DNS管理员寻求帮助。 - 以管理员身份打开Powershell窗口。
- 执行以下命令以允许运行未签名的脚本:
Set-ExecutionPolicy Unrestricted
执行以下指令以导入此模块,然后就可以愉快的使用了!:smile:
Import-Module AliyunDNS
Get-AliyunDNSRecord
[Mandatory]-Doamin <DomainName>
[Mandatory]-RecordId <RecordId>
[Mandatory]-SubDomain <SubDomainName>
-PageNumber <PageNo>
-PageSize <PageSize>
-Type <RecordType>
注意: 在这个命令中你只允许传入一个强制参数。
New-AliyunDNSRecord
[Mandatory]-DomainName <DomainName>
[Mandatory]-RR <Host>
[Mandatory]-Type <RecordType>
[Mandatory]-Value <RecordValue>
-TTL <TTL>
-Priority <Priority>
-Line <Line>
Update-AliyunDNSRecord
[Mandatory]-RecordId <RecordId>
[Mandatory]-RR <Host>
[Mandatory]-Type <RecordType>
[Mandatory]-Value <RecordValue>
-TTL <TTL>
-Priority <Priority>
-Line <Line>
Set-AliyunDNSRecordStatus
[Mandatory]-RecordId <RecordId>
[Mandatory]-Status <Status>
Remove-AliyunDNSRecord
[Mandatory]-RecordId <RecordId>
Get-AliyunDomain
-DomainName <DomainName>
-WhoIs <$True|$False>
Get-AliyunDomain
-PageNumber <PageNumber>
-PageSize <PageSize>
Get-AliyunDomainLogs
-PageNumber <PageNumber>
-PageSize <PageSize>
-KeyWord <Keyword>
Get-MainDomain
-InputString <HostName>
更多帮助信息请使用help <Command>
查询