zoukankan      html  css  js  c++  java
  • 正向dns脚本

    #!/bin/bash

    cat << END >> /etc/hosts
    192.168.200.132 ns1.wangrui.com
    END
    echo "hosts文件成功"
    cat << EOF >> /etc/resolv.conf
    nameserver 192.168.200.132
    EOF
    echo "dns文件成功"
    [ -d /etc/named.conf ] || yum -y install bind bind-utils bind-libs &> /dev/null
    echo "bind安装完成"
    cat << OBG > /etc/named.conf
    options {
            directory       "/var/named";
    };
    zone "wangrui.com" IN {
            type master;
            file "wangrui.com.zheng";
    };
    OBG
    echo "主配置文件成功"
    cat << OBGC > /var/named/wangrui.com.zheng
    $TTL    1D
    @       IN      SOA     wangrui.com.        admin.wangrui.com. (
                    20190826
                    1D
                    1H
                    1W
                    3H )
            NS      ns1.wangrui.com.
            MX  10  mail.wangrui.com.
    www     A       192.168.200.100
    xiao    A       192.168.200.151
    file    CNAME   xiao
    *       A       192.168.200.121
    OBGC
    echo "文件成功"
    #启动服务
    systemctl restart named
    systemctl enable  named
  • 相关阅读:
    JavaScript if 条件语句
    JavaScript while 循环
    JavaScript for 循环
    JavaScript 字典
    JavaScript 数组
    JavaScript 函数
    JavaScript 定时器
    JavaScript 字符串操作
    CEF js调用C#封装类含注释
    多网卡的环境下的发包
  • 原文地址:https://www.cnblogs.com/wrwrwrwr/p/11415048.html
Copyright © 2011-2022 走看看