Windows Server 2016 智能DNS(五) 我们前面几篇文章介绍了如何Windows Server 2016 智能DNS的相关配置介绍,今天继续介绍Windows Server 2016 智能DNS的配置管理,前面我们介绍了根据自己的需求来配置相关功能,但是对于配置的相关命令我们如何修改呢?当然既然有创建,肯定会有相关的编辑、删除命令,那今天没我就来说说相关记录的编辑操作。 首先是子网: 首先查看子网 `Get-DnsServerClientSubnet` ![DNS](https://s4.51cto.com/images/blog/201803/11/d9731815c59b0bdbd8295dce785486d5.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 如果对现有的子网进行增加及删除我们有了解到参数 ``` -action add 是增加子网 -action remove是删除子网 ``` 首先是增加: `set-dnsserverclientsubnet -name "USSubnet" -action add -IPv4Subnet "192.168.7.0/24" ` ![DNS](https://s4.51cto.com/images/blog/201803/11/ea23ef565a22c22e0e09c4d6547a9587.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 然后是删除 `set-dnsserverclientsubnet -name "USSubnet" -action remove -IPv4Subnet "192.168.7.0/24" ` ![](https://s4.51cto.com/images/blog/201803/11/217e3c07d72e105b7bd5b1ac8af69490.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 当然删除子网的命令就简单了 `Remove-DnsServerClientSubnet -Name "SubnetName"` 2.然后就是DNS区域 `查看:Get-DnsServerZoneScope -ZoneName "byssoft.com"` ![DNS](https://s4.51cto.com/images/blog/201803/11/82eda4b8177fb7b64c18aecf08b94d23.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) ``` 增加:add-DnsServerZoneScope -ZoneName "ZoneName" 删除:remove-DnsServerZoneScope -ZoneName "ZoneName" ``` 3.DNS 区域记录: 首先查看 ` Get-DnsServerResourceRecord -ZoneName "byssoft.com" -zonescope "USZoneScope"` ![DNS](https://s4.51cto.com/images/blog/201803/11/729a779d587f975d39475fe581579247.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 增加: ![DNS](https://s4.51cto.com/images/blog/201803/11/43f70c41fe5a501b44f508ce5e6faaff.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 编辑:修改IP地址 ``` $Record = Get-DnsServerResourceRecord -ZoneName "byssoft.com" -Name "g" -ZoneScope "USZoneScope" $NewRecord = $Record.Clone() $NewRecord.RecordData.IPv4Address = '192.168.20.20' Set-DnsServerResourceRecord -ZoneName byssoft.com -ZoneScope "USZoneScope" -OldInputObject $Record -NewInputObject $NewRecord ``` ![](https://s4.51cto.com/images/blog/201803/11/8617d65506dcc5c5a655e65fda8b0292.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) 删除: `Remove-DnsServerResourceRecord -ZoneName "byssoft.com" -RRType "A" -name "g" -RecordData "192.168.20.20" -ZoneScope "USZoneScope"` ![DNS](https://s4.51cto.com/images/blog/201803/11/3cecc974b3caf7f58dd9fcaeb3dc5c67.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) ![DNS](https://s4.51cto.com/images/blog/201803/11/94fc354aa2d1c4d8d5bb02546b239e1c.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)