CoreDNS Windows

本文介绍了如何在Windows上配置CoreDNS服务,包括编写Corefile配置文件,利用WinSW安装服务,以及设置开机自启。详细步骤包括安装WinSW,编写xml配置文件,注册和启动服务,最终通过nslookup测试验证服务正常运行。
摘要由CSDN通过智能技术生成


此篇博文针对Windows下的CoreDNS配置

首先写Corefile配置文件

.:53 {
    # 绑定interface ip
    bind 127.0.0.1
    # 先走本机的hosts
    hosts C:\Windows\System32\drivers\etc\hosts {
        fallthrough
    }
    # 转发上游dns服务器
    forward . tls://223.5.5.5:853 {
        tls_servername dns.alidns.com
        force_tcp
        max_fails 3
    }
    # 缓存时间ttl
    cache 120
    reload 10s
    log
    errors
}

注册服务且开机自启

准备注册服务,但是,我尝试了以下方式都启动失败了

New-Service -Name "CoreDNS" -BinaryPathName '"D:\Applications\apps\coredns\1.8.3\coredns.exe -conf D:\Applications\apps\coredns\Corefile"' -Description "CoreDNS Service" -StartupType "Automatic"
New-Service -Name "CoreDNS" -BinaryPathName '"powershell -file D:\Applications\apps\coredns\CorednsService.ps1 -WindowStyle Hidden"' -Description "CoreDNS Service" -StartupType "Automatic&#
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值