加入收藏 | 设为首页 | 会员中心 | 我要投稿 西安站长网 (https://www.029zz.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 业界 > 正文

使用 CoreDNS 来应对 DNS 污染

发布时间:2019-04-03 04:30:26 所属栏目:业界 来源:yangcs
导读:副标题#e# CoreDNS 是新晋的 CNCF 孵化项目,前几天已经从 CNCF 正式毕业,并正式成为 Kubernetes 的 DNS 服务器。CoreDNS 的目标是成为 cloud-native 环境下的 DNS 服务器和服务发现解决方案,即: Our goal is to make CoreDNS the cloud-native DNS serv

查看服务:

  1. $ sudo launchctl list|grep coredns  
  2. 61676   0   coredns 
  1. $ sudo launchctl list coredns 
  2.  
  3.     "StandardOutPath" = "/var/log/coredns.stdout.log"; 
  4.     "LimitLoadToSessionType" = "System"; 
  5.     "StandardErrorPath" = "/var/log/coredns.stderr.log"; 
  6.     "Label" = "coredns"; 
  7.     "TimeOut" = 30; 
  8.     "OnDemand" = false; 
  9.     "LastExitStatus" = 0; 
  10.     "PID" = 61676; 
  11.     "Program" = "/usr/local/bin/coredns"; 
  12.     "ProgramArguments" = ( 
  13.         "/usr/local/bin/coredns"; 
  14.         "-conf"; 
  15.         "/usr/local/etc/Corefile"; 
  16.     ); 
  17. }; 

查看端口号:

  1. $ sudo ps -ef|egrep -v grep|grep coredns 
  2.  
  3.     0 81819     1   0  2:54下午 ??         0:04.70 /usr/local/bin/coredns -conf /usr/local/etc/Corefile 
  4.      
  5. $ sudo lsof -P -p 81819|egrep "TCP|UDP" 
  6.  
  7. coredns 81819 root    5u    IPv6 0x1509853aadbdf853      0t0     TCP *:5302 (LISTEN) 
  8. coredns 81819 root    6u    IPv6 0x1509853acd2f39ab      0t0     UDP *:5302 
  9. coredns 81819 root    7u    IPv6 0x1509853aadbdc493      0t0     TCP *:53 (LISTEN) 
  10. coredns 81819 root    8u    IPv6 0x1509853acd2f5a4b      0t0     UDP *:53 
  11. coredns 81819 root    9u    IPv6 0x1509853ac63bfed3      0t0     TCP *:5301 (LISTEN) 
  12. coredns 81819 root   10u    IPv6 0x1509853acd2f5d03      0t0     UDP *:5301 

大功告成,现在你只需要将系统的 DNS IP 设置为 127.0.0.1 就可以了。

(编辑:西安站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读