mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #2505 from pi-hole/fix/DNS_with_hash
Account for non-standard ports in DNS server addresses.
This commit is contained in:
commit
65a3da92f1
1 changed files with 7 additions and 1 deletions
|
@ -257,7 +257,13 @@ gravity_DownloadBlocklistFromUrl() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "${blocked}" == true ]]; then
|
if [[ "${blocked}" == true ]]; then
|
||||||
ip=$(dig "@${PIHOLE_DNS_1}" +short "${domain}")
|
printf -v ip_addr "%s" "${PIHOLE_DNS_1%#*}"
|
||||||
|
if [[ ${PIHOLE_DNS_1} != *"#"* ]]; then
|
||||||
|
port=53
|
||||||
|
else
|
||||||
|
printf -v port "%s" "${PIHOLE_DNS_1#*#}"
|
||||||
|
fi
|
||||||
|
ip=$(dig "@${ip_addr}" -p "${port}" +short "${domain}")
|
||||||
if [[ $(echo "${url}" | awk -F '://' '{print $1}') = "https" ]]; then
|
if [[ $(echo "${url}" | awk -F '://' '{print $1}') = "https" ]]; then
|
||||||
port=443;
|
port=443;
|
||||||
else port=80
|
else port=80
|
||||||
|
|
Loading…
Reference in a new issue