zoukankan      html  css  js  c++  java
  • Saltstack module dnsutil 详解

    dnsutil.hosts_remove

    Remove a host from the /etc/hosts file. If doing so will leave a line
    containing only an IP address, then the line will be deleted. This function
    will leave comments and blank lines intact.
    
    CLI Examples:
    
        salt '*' dnsutil.hosts_remove /etc/hosts ad1.yuk.co
        salt '*' dnsutil.hosts_remove /etc/hosts ad2.yuk.co,ad1.yuk.co
    

    dnsutil.MX

    Return a list of lists for the MX of ``domain``.
    
    If the 'resolve' argument is True, resolve IPs for the servers.
    
    It's limited to one IP, because although in practice it's very rarely a
    round robin, it is an acceptable configuration and pulling just one IP lets
    the data be similar to the non-resolved version. If you think an MX has
    multiple IPs, don't use the resolver here, resolve them in a separate step.
    
    CLI Example:
    
        salt ns1 dnsutil.MX google.com
    

    dnsutil.parse_hosts

    Parse /etc/hosts file.
    
    CLI Example:
    
        salt '*' dnsutil.parse_hosts
    

    dnsutil.check_ip

    Check that string ip_addr is a valid IP
    
    CLI Example:
    
        salt ns1 dnsutil.check_ip 127.0.0.1
    

    dnsutil.NS

    Return a list of IPs of the nameservers for ``domain``
    
    If 'resolve' is False, don't resolve names.
    
    CLI Example:
    
        salt ns1 dnsutil.NS google.com
    

    dnsutil.serial

    Return, store and update a dns serial for your zone files.
    
    zone: a keyword for a specific zone
    
    update: store an updated version of the serial in a grain
    
    If ``update`` is False, the function will retrieve an existing serial or
    return the current date if no serial is stored. Nothing will be stored
    
    If ``update`` is True, the function will set the serial to the current date
    if none exist or if the existing serial is for a previous date. If a serial
    for greater than the current date is already stored, the function will
    increment it.
    
    This module stores the serial in a grain, you can explicitly set the
    stored value as a grain named ``dnsserial_<zone_name>``.
    
    CLI Example:
    
        salt ns1 dnsutil.serial example.com
    

    dnsutil.SPF

    Return the allowed IPv4 ranges in the SPF record for ``domain``.
    
    If record is ``SPF`` and the SPF record is empty, the TXT record will be
    searched automatically. If you know the domain uses TXT and not SPF,
    specifying that will save a lookup.
    
    CLI Example:
    
        salt ns1 dnsutil.SPF google.com
    

    dnsutil.hosts_append

    Append a single line to the /etc/hosts file.
    
    CLI Example:
    
        salt '*' dnsutil.hosts_append /etc/hosts 127.0.0.1 ad1.yuk.co,ad2.yuk.co
    

    dnsutil.A

    Return the A record(s) for ``host``.
    
    Always returns a list.
    
    CLI Example:
    
        salt ns1 dnsutil.A www.google.com
    

    dnsutil.AAAA

    Return the AAAA record(s) for ``host``.
    
    Always returns a list.
    
    New in version 2014.7.5
    
    CLI Example:
    
        salt ns1 dnsutil.AAAA www.google.com
    

    dnsutil.parse_zone

    Parses a zone file. Can be passed raw zone data on the API level.
    
    CLI Example:
    
        salt ns1 dnsutil.parse_zone /var/lib/named/example.com.zone
  • 相关阅读:
    O(1)时间复杂度实现入栈、出栈、获得栈中最小元素、获得栈中最大元素(转)
    北京网选赛第二题(最大仰望角度)
    最小圆覆盖(随机增量法&模拟退火法)
    模拟退火算法A Star not a Tree?(poj2420)
    模拟退火算法(run away poj1379)
    模拟退火算法(西安网选赛hdu5017)
    最小费用流判负环消圈算法(poj2175)
    中国邮递员问题(一)
    破坏行动问题
    进化树问题
  • 原文地址:https://www.cnblogs.com/randomlee/p/Saltstack_module_dnsutil.html
Copyright © 2011-2022 走看看