DEFAULT_RESOLVER google
This commit is contained in:
+2
-4
@@ -11,10 +11,8 @@ NC='\033[0m' # No Color
|
||||
|
||||
TO_BE_DEFINED="TO BE DEFINED"
|
||||
|
||||
FDN_DOMAINNAME=fdn.fr
|
||||
FDN_NAMESERVER="ns0.$FDN_DOMAINNAME"
|
||||
FDN_RESOLVER=80.67.169.12
|
||||
: $FDN_DOMAINNAME $FDN_NAMESERVER $FDN_RESOLVER
|
||||
DEFAULT_RESOLVER=8.8.8.8 # google !!!
|
||||
: $DEFAULT_RESOLVER
|
||||
|
||||
function echo() {
|
||||
[[ -n ${PREFIX:-} ]] && printf "${DARK}%25.25s${NC} " "${PREFIX}"
|
||||
|
||||
+3
-3
@@ -372,12 +372,12 @@ function miaou_resolver() {
|
||||
gateway=$(ip route | grep default | cut -d' ' -f3)
|
||||
|
||||
echo -n "test gateway <$gateway> as DNS resolver..."
|
||||
if dig +short "@$gateway" "$FDN_DOMAINNAME" >/dev/null; then
|
||||
if dig +short "@$gateway" "$DEFAULT_RESOLVER" >/dev/null; then
|
||||
resolver="$gateway"
|
||||
PREFIX="" echoinfo DONE
|
||||
else
|
||||
PREFIX="" echoinfo "finally replaced by FDN_RESOLVER=<$FDN_RESOLVER>"
|
||||
resolver="$FDN_RESOLVER"
|
||||
PREFIX="" echoinfo "finally replaced by DEFAULT_RESOLVER=<$DEFAULT_RESOLVER>"
|
||||
resolver="$DEFAULT_RESOLVER"
|
||||
fi
|
||||
|
||||
if command -v nmcli &>/dev/null; then
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ function build_dmz_certbot {
|
||||
#TODO: check public ip available
|
||||
my_ip=$(dig +short myip.opendns.com @resolver1.opendns.com)
|
||||
public_hostname=$(hostname -f)
|
||||
public_ip=$(dig +short A "${public_hostname}" "@${FDN_NAMESERVER}")
|
||||
public_ip=$(dig +short A "${public_hostname}" "@${DEFAULT_RESOLVER}")
|
||||
|
||||
if hostname -I | grep -q "$my_ip"; then
|
||||
echo "My PUBLIC IP address is: <$my_ip>"
|
||||
|
||||
Reference in New Issue
Block a user