Skip to content

Instantly share code, notes, and snippets.

@hatan4ik
Forked from antonlindstrom/dnscheck
Created January 24, 2019 20:34
Show Gist options
  • Save hatan4ik/40a4794003d3862d1c44c95c9a7aa9ac to your computer and use it in GitHub Desktop.
Save hatan4ik/40a4794003d3862d1c44c95c9a7aa9ac to your computer and use it in GitHub Desktop.

Revisions

  1. @antonlindstrom antonlindstrom revised this gist Oct 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion keepalived.conf
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,7 @@ virtual_server 10.0.2.16 53 {

    }

    # Check for TCP (might work)
    # Check for TCP
    virtual_server 10.0.2.16 53 {
    delay_loop 6
    lb_algo wlc
  2. @antonlindstrom antonlindstrom revised this gist Jul 22, 2011. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions keepalived.conf
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,7 @@ vrrp_instance dns_test {
    }
    }

    # Check for UDP
    virtual_server 10.0.2.16 53 {
    delay_loop 6
    lb_algo wlc
    @@ -34,3 +35,26 @@ virtual_server 10.0.2.16 53 {
    }

    }

    # Check for TCP (might work)
    virtual_server 10.0.2.16 53 {
    delay_loop 6
    lb_algo wlc
    protocol TCP

    real_server 10.0.2.20 53 {
    weight 100
    TCP_CHECK {
    connect_timeout 6
    }
    }

    real_server 10.0.2.21 53 {
    weight 100
    TCP_CHECK {
    connect_timeout 6
    }
    }

    }

  3. @invalid-email-address Anonymous created this gist Jul 22, 2011.
    18 changes: 18 additions & 0 deletions dnscheck
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/bin/bash
    #$Id: keepalivepin,v 1.2 2006/02/27 07:30:41 hmy Exp hmy $
    #use dig check the powerdns's status.
    #in the dns database,have a IN TXT RR keepalivepin.vmmatrix.net,content is "AaBbCcDdEeFf"
    # Source: http://puppet-manifest-share.googlecode.com/svn/trunk/vmx-puppet/modules/lvs/files/keepalived.dns-pin
    #
    RR=keepalivepin.vmmatrix.net
    [ $# -le 1 ]&&{ echo "usage: ${0} -h <ip>"; exit 126;}
    while getopts "h:" OPT;do
    case $OPT in
    h)host=$OPTARG;;
    *)echo "usage: $0 -h <ip>"&&exit 1;;
    esac
    done


    dig @${host} txt ${RR}|grep "\<AaBbCcDdEeFf\>" >/dev/null
    exit $?
    36 changes: 36 additions & 0 deletions keepalived.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    vrrp_instance dns_test {
    interface eth0
    state MASTER
    virtual_router_id 51
    priority 100
    authentication {
    auth_type PASS
    auth_pass p4ssw0rd
    }
    virtual_ipaddress {
    10.0.2.16/24 dev eth0
    }
    }

    virtual_server 10.0.2.16 53 {
    delay_loop 6
    lb_algo wlc
    protocol UDP

    real_server 10.0.2.20 53 {
    weight 100
    MISC_CHECK {
    connect_timeout 6
    misc_path "/etc/keepalived/dnscheck -h 10.0.2.20"
    }
    }

    real_server 10.0.2.21 53 {
    weight 100
    MISC_CHECK {
    connect_timeout 6
    misc_path "/etc/keepalived/dnscheck -h 10.0.2.21"
    }
    }

    }