zoukankan      html  css  js  c++  java
  • Dnsmasq域名解析系统安装配置

    Dnsmasq使用上比bind要简便得多,可以做正向、反向dns解析,支持DHCP服务。也可以做内部dns服务器用。

    默认下,dnsmasq使用系统的/etc/resolv.conf,并读取/etc/hosts文件。

    1.安装dnsmasq软件

    yum install dnsmasq

    2.编辑配置文件/etc/dnsmasq.conf

    cache-size=10000  #缓存条数
    resolv-file=/etc/dnsmasq-resolv.conf  #上一级DNS
    addn-hosts=/etc/dnsmasq.hosts  #本地域名配置文件(不支持泛域名)
    log-queries
    log-facility=/var/log/dnsmasq.log
    local-ttl=600  #DHCP租约时间
    conf-dir=/etc/dnsmasq.d

    3.修改上游DNS配置文件/etc/dnsmasq-resolv.conf

    nameserver x.x.x.x

    3.1编辑本地域名配置文件/etc/dnsmasq.hosts(添加内部需要解析的地址和域名)(重新加载即可生效)

    127.0.0.1 www.qq.com #IP 域名

    3.2 编辑支持泛域名的配置文件/etc/dnsmasq.d/address.conf(编辑后需要重启服务才生效)

    address=/www.taobao.com/127.0.0.1  #正向解析
    ptr-record=127.0.0.1.in-addr.arpa,www.taobao.com    #反向解析(可选)
    
    address=/baidu.com/127.0.0.1    #泛域名解析

     4.配置日志轮转,编辑/etc/logrotate.d/dnsmasq

    /var/log/dnsmasq.log {
        daily
        copytruncate
        missingok
        rotate 30
        compress
        notifempty
        dateext
        size 200M
    } 

    参考链接

  • 相关阅读:
    django--orm---006
    django--orm---005
    django--orm---004
    django--orm---003
    jmeter连接数据库
    django--view---001
    django--orm---002
    django--model--orm001-- 增删改查
    java并发编程
    jvm
  • 原文地址:https://www.cnblogs.com/wsl222000/p/5981299.html
Copyright © 2011-2022 走看看