解决暂停解析的域名记录

  

<强>需求:
<强> IDC机房通报一堆客户接口域名过期掉备案了,需要我这边判断这些域名里那边是客户那边已经暂停解析的,那些是还有解析记录的,然后通知客户暂停域名解析

  

<强>先排序去除重复的域名:

  
 <代码>猫2。txt排序rn | | uniq - c | awk{打印$ 2}的祝辞b.txt  
  

<强>从b。txt这个文件中查找那些还是有解析记录的:

  
 <代码> n '猫/root/b.txt;做呼应n&美元;萍往上平移- 0.1 $ n—q | grep“ping”| grep - v 127.0.0.1,做; 
  

<>强执行过程中输出的内容如下:

  
 <代码>
  [1]38765
  m.z3o8i.cn
  [1]+ echo $ n
  [1]38769
  m.z1w4ri.cn
  [1]+ echo $ n
  [1]38773
  m.yunranfa.cn
  PING s.cooolyi.cn(221.195.1.103) 56(84)字节的数据。
  [1]+ echo $ n
  [1]38835
  m.yunnvjie.cn
  PING s.cooolyi.cn(183.60.136.216) 56(84)字节的数据。
  [1]+ echo $ n
  [1]38839
  m.yqbyiw86.cn
  PING s.cooolyi.cn(183.60.136.216) 56(84)字节的数据。
  [1]+做echo $ n  
  

把上面的输出的内容追加到文件11。txt文件
<>强过滤出还有解析的,以m开头的二级域名:

  
 <代码> sed - e '/完成/{d} - e '/\ [1 \]/{d} ' 11。txt | grep - b 1“PING”| grep“^ m” 
  

<>强过滤出还有解析的,以. cn结尾和com结尾的二级域名:

  
 <代码> [root@localhost ~] # sed - e '/完成/{d} - e '/\ [1 \]/{d} ' 11。txt | grep - b 1“PING”| grep“。cn”美元|头2
  m.yunranfa.cn
  m.yunnvjie.cn
  
  (root@localhost ~) # sed - e '/完成/{d} - e '/\ [1 \]/{d} ' 11。txt | grep - b 1“PING”| grep美元“。com”|头2
  m.vhu5j1.com
  m.qeiuke.com  

解决暂停解析的域名记录