

___x_cmd_dns_current(){
    local x_
    ___x_cmd os name_
    case "$x_" in
        darwin)     ___x_cmd_dns_current___darwin ;;
        linux)      ___x_cmd_dns_current___linux  ;;
        *)          N=dns M="Unsupported os ==> $x_" log:ret:1 ;;
    esac
}

___x_cmd_dns_current___darwin(){
    command scutil --dns | ___x_cmd_cmds_awk -f "$___X_CMD_ROOT_MOD/dns/lib/awk/scutil.awk"
}

___x_cmd_dns_current___linux(){
    local i=0
    while read -r line; do
        case "$line" in
            nameserver*)
                printf "%s: %s\n" $i "${line#nameserver}"
                i=$((i+1))
                ;;
        esac
    done </etc/resolv.conf
}

___x_cmd_dns_set(){
    x:warn "Unimplmented. We will try to implement this function in the future"
    x:info "Please visit https://x-cmd.com/dns. We will provide information about setting dns on specific os with our best effort."
    return 0
}

___x_cmd_dns_add(){
    :
}

___x_cmd_dns_rm(){
    :
}
