当前位置: 首页 > news >正文

windows dns远程添加A记录

windows dns远程添加A记录


Dns服务器地址:192.168.1.1
域名:bj.com
新增解析:
docs.bj.com 192.168.1.2

from winrm.protocol import Protocol
url = 'http://192.168.1.1:5985/wsman'
username = 'bj.com\\administrator'
password = password
session = Protocol(endpoint=url,transport='ntlm',username=username,password=password,server_cert_validation='ignore'
)
shell_id = session.open_shell()
powershell_command = 'powershell -Command Add-DnsServerResourceRecordA -ZoneName "bj.com" -Name "docs" -IPv4Address "192.168.1.2"'
result = session.run_command(shell_id, powershell_command)
# std_out, std_err, status_code = session.get_command_output(shell_id, result)
print(session.get_command_output(shell_id, result))
session.cleanup_command(shell_id, result)
session.close_shell(shell_id)

删除A记录:

Remove-DnsServerResourceRecord -ZoneName "example.com" -Name "www" -RRType "A" -RecordData "192.168.1.100" -Force
http://www.xdnf.cn/news/17929.html

相关文章:

  • Android 证书 是什么
  • Redis ③-Linux下载Redis
  • 长图分段打印方法
  • Linux:通过ssh实现端口转发
  • 2025接口测试趋势前瞻:核心策略、工具演进与实战场景解析
  • golang context源码
  • kkFileView安装及使用
  • 深入浅出 Multi-Head Attention:原理 + 例子 + PyTorch 实现
  • 数字信号处理技术架构与功能演进
  • 鸿蒙语言基础
  • 如何在直播App中集成美颜SDK?人脸美型功能从0到1实现指南
  • 基于 HT 数字孪生智慧交通可视化系统
  • 安卓App中调用升级接口并实现版本检查和升级功能的完整方案
  • IP检测工具“ipjiance”
  • MySQL锁详解
  • 2025年大数据实训室建设及大数据实训平台解决方案
  • Vmware esxi 查看硬盘健康状况
  • 【深度学习】张量计算:爱因斯坦求和约定|tensor系列03
  • 如何才能学会代数几何,代数几何的前置学科是什么
  • 使用Trae CN分析项目架构
  • 理解.NET Core中的配置Configuration
  • 时序逻辑电路——序列检测器
  • 【Contiki】Contiki process概述
  • 基于slimBOXtv 9.16 V2-晶晨S905L3A/ S905L3AB-Mod ATV-Android9.0-线刷通刷固件包
  • 铁氧体和纳米晶:车载定制电感的材料选择
  • 什么是Python单例模式
  • 解决方德桌面操作系统V5.0-G23没ll命令的问题
  • 以太网交换机介绍
  • Docker compose使用、容器迁移
  • 3个实用的脚本