Pi-Hole gravity update fails

Just to mention this again, I can not use the template as I have selected "Help Docker"

anyway

I run the command "sudo docker exec pi-hole pihole -g" or press update gravity in the web interface and get "DNS resolution is currently unavailable" and the a timeout

is this normal for docker or is there an issue somewhere

I am running 2024.07.0

I am sorry but, I though this would be a quick answer of "yes its normal or no its not, try this"
10 hours, I normally get quick replies here
I know I need to be patient and wait, but its really hard for me

No, it's not normal.

so like I said what can I try?

I just a did debug log, but only to local storage

Last gravity run finished at: Fri May 17 10:06:13 UTC 2024

does that mean its not updated the gravity database since May

Possibly. If you want to post the debug log token or the full debug log contents then we may be able to help.

Is there a reason you are running an outdated docker image?

outdated?

Your debug token is: https://tricorder.pi-hole.net/qS2rjcgP/

Sorry, I read the docker image tag as 2024.01 (January).

How are you starting your docker container? If docker run the please show your full command in your reply. If using an orchestrator then please post that configuration.

It doesn't look like Pi-hole has ever updated the lists after they were initially added.

*** [ DIAGNOSING ]: Adlists
   id     enabled  group_ids     address                                                                                               date_added           date_modified        comment                                           
   -----  -------  ------------  ----------------------------------------------------------------------------------------------------  -------------------  -------------------  --------------------------------------------------
   28           1  0             https://<REDACT>/abuse.txt                                                    2024-04-25 10:55:57  2024-04-25 10:55:57   

is /etc/resolv.conf used for internal requests as the docker container has an old ip address, even though the container is started fresh

$ sudo docker exec pi-hole cat /etc/resolv.conf
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 127.0.0.11
options ndots:0

# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [10.42.0.252 1.1.1.1]
# Overrides: []
# Option ndots from: internal

10.42.0.252 is the old ip of pi-hole
its new ip is 192.168.1.252
where does this get set from
thats hashed anyway so its not being used

sudo docker run --name pi-hole --network macvlan0 --hostname "pi-hole" --ip 192.168.1.252 -e WEBPASSWORD=###-v /docker/pi-hole-1/etc/dnsmasq.d:/etc/dnsmasq.d -v /docker/pi-hole-1/etc/pihole:/etc/pihole --cap-add=NET_ADMIN pihole/pihole &

it always says it used a local copy

/etc/resolv.con where? On the host or in the container?

Run sudo docker container exec pi-hole cat /etc/resolv.conf and sudo docker container exec pi-hole dig pi-hole.net

within the container

pi@raspberrypi5:~ $  sudo docker container exec pi-hole cat /etc/resolv.conf
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 127.0.0.11
options ndots:0

# Based on host file: '/etc/resolv.conf' (internal resolver)
# ExtServers: [10.42.0.252 1.1.1.1]
# Overrides: []
# Option ndots from: internal
pi@raspberrypi5:~ $ sudo docker container exec pi-hole dig pi-hole.net

; <<>> DiG 9.16.48-Debian <<>> pi-hole.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12746
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;pi-hole.net.			IN	A

;; ANSWER SECTION:
pi-hole.net.		300	IN	A	3.18.136.52

;; Query time: 4023 msec
;; SERVER: 127.0.0.11#53(127.0.0.11)
;; WHEN: Wed Nov 20 22:43:31 UTC 2024
;; MSG SIZE  rcvd: 56


That all looks fine and is resolving.

Post the full output from the pihole -g command you are running please.

I found where it was getting 10.42.0.252 from setupvars.conf I think
Edit: that was the conditional forwarding I think, I do not use that

anyway here is the output of pihole -g

pi@raspberrypi5:~ $ sudo docker exec pi-hole pihole -g
  [✗] DNS resolution is currently unavailable
  [i] Time until retry: 93

Try sudo docker exec pi-hole /bin/bash -x /opt/pihole/gravity.sh

sorry for the delayed response, it was 11PM last time I was here

$ sudo docker exec pi-hole /bin/bash -x /opt/pihole/gravity.sh
+ export LC_ALL=C
+ LC_ALL=C
+ coltable=/opt/pihole/COL_TABLE
+ source /opt/pihole/COL_TABLE
++ [[ -t 1 ]]
++ [[ -n '' ]]
++ COL_BOLD=
++ COL_ULINE=
++ COL_NC=
++ COL_GRAY=
++ COL_RED=
++ COL_GREEN=
++ COL_YELLOW=
++ COL_BLUE=
++ COL_PURPLE=
++ COL_CYAN=
++ COL_WHITE=
++ COL_BLACK=
++ COL_LIGHT_BLUE=
++ COL_LIGHT_GREEN=
++ COL_LIGHT_CYAN=
++ COL_LIGHT_RED=
++ COL_URG_RED=
++ COL_LIGHT_PURPLE=
++ COL_BROWN=
++ COL_LIGHT_GRAY=
++ COL_DARK_GRAY=
++ TICK='[✓]'
++ CROSS='[✗]'
++ INFO='[i]'
++ QST='[?]'
++ DONE=' done!'
++ OVER='\r'
+ source /etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh
++ readonly scriptPath=/etc/.pihole/advanced/Scripts/database_migration/gravity
++ scriptPath=/etc/.pihole/advanced/Scripts/database_migration/gravity
+ basename=pihole
+ PIHOLE_COMMAND=/usr/local/bin/pihole
+ piholeDir=/etc/pihole
+ whitelistFile=/etc/pihole/whitelist.txt
+ blacklistFile=/etc/pihole/blacklist.txt
+ regexFile=/etc/pihole/regex.list
+ adListFile=/etc/pihole/adlists.list
+ localList=/etc/pihole/local.list
+ VPNList=/etc/openvpn/ipp.txt
+ piholeGitDir=/etc/.pihole
+ gravityDBfile_default=/etc/pihole/gravity.db
+ GRAVITYDB=/etc/pihole/gravity.db
+ gravityDBschema=/etc/.pihole/advanced/Templates/gravity.db.sql
+ gravityDBcopy=/etc/.pihole/advanced/Templates/gravity_copy.sql
+ domainsExtension=domains
+ curl_connect_timeout=10
+ setupVars=/etc/pihole/setupVars.conf
+ [[ -f /etc/pihole/setupVars.conf ]]
+ source /etc/pihole/setupVars.conf
++ PIHOLE_INTERFACE=eth0
++ IPV4_ADDRESS=0.0.0.0
++ IPV6_ADDRESS=0:0:0:0:0:0
++ QUERY_LOGGING=true
++ INSTALL_WEB_SERVER=true
++ INSTALL_WEB_INTERFACE=true
++ LIGHTTPD_ENABLED=true
++ CACHE_SIZE=10000
++ DNS_FQDN_REQUIRED=true
++ DNS_BOGUS_PRIV=true
++ DNSMASQ_LISTENING=single
++ WEBPASSWORD=3d34505395accc6d2cc7ca7dccf5d49fc5ca72f79ca6afc99b13b1fe72284407
++ BLOCKING_ENABLED=true
++ DNSSEC=false
++ REV_SERVER=false
++ REV_SERVER_CIDR=192.168.0.0/16
++ REV_SERVER_TARGET=192.168.1.1
++ REV_SERVER_DOMAIN=
++ API_EXCLUDE_DOMAINS=_dns.resolver.arpa,one.one.one.one,backup.cn,lb._dns-sd._udp.0.0.168.192.in-addr.arpa,lb._dns-sd._udp.6.0.0.192.in-addr.arpa,lb._dns-sd._udp.cn-lan,lb._dns-sd._udp.2.0.0.192.in-addr.arpa,wpad.cn-lan,mask.icloud.com,mask-h2.icloud.com
++ API_EXCLUDE_CLIENTS=
++ API_QUERY_LOG_SHOW=all
++ DHCP_ACTIVE=true
++ DHCP_START=192.168.1.2
++ DHCP_END=192.168.255.255
++ DHCP_ROUTER=192.168.1.1
++ DHCP_LEASETIME=744
++ PIHOLE_DOMAIN=CN-LAN
++ DHCP_IPv6=false
++ DHCP_rapid_commit=true
++ PIHOLE_DNS_1=1.1.1.1
+ : /tmp
+ '[' '!' -d /tmp ']'
+ '[' '!' -w /tmp ']'
+ pihole_FTL=/etc/pihole/pihole-FTL.conf
+ [[ -f /etc/pihole/pihole-FTL.conf ]]
+ source /etc/pihole/pihole-FTL.conf
++ RATE_LIMIT=300/60
++ BLOCKINGMODE=IP
++ PRIVACYLEVEL=0
++ BLOCK_ICLOUD_PR=true
++ MOZILLA_CANARY=false
++ REFRESH_HOSTNAMES=UNKNOWN
++ REPLY_WHEN_BUSY=ALLOW
++ MACVENDORDB=/macvendor.db
++ LOCAL_IPV4=0.0.0.0
++ DBINTERVAL=0.01
++ MAXDBDAYS=300
+ gravityDBfile=/etc/pihole/gravity.db
+ gravityTEMPfile=/etc/pihole/gravity.db_temp
++ dirname -- /etc/pihole/gravity.db
+ gravityDIR=/etc/pihole
+ gravityOLDfile=/etc/pihole/gravity_old.db
+ [[ -z IP ]]
+ [[ -r /etc/pihole/pihole.conf ]]
+ [[ -f /etc/pihole/gravity_old.db ]]
+ gravity_Trap
+ trap '{ echo -e "\\n\\n  ${INFO} ${COL_LIGHT_RED}User-abort detected${COL_NC}"; gravity_Cleanup "error"; }' INT
+ [[ '' == true ]]
+ [[ '' == true ]]
+ migrate_to_database
+ '[' '!' -e /etc/pihole/gravity.db ']'
+ upgrade_gravityDB /etc/pihole/gravity.db /etc/pihole
+ local database piholeDir auditFile version
+ database=/etc/pihole/gravity.db
+ piholeDir=/etc/pihole
+ auditFile=/etc/pihole/auditlog.list
++ pihole-FTL sqlite3 -ni /etc/pihole/gravity.db 'SELECT "value" FROM "info" WHERE "property" = '\''version'\'';'
+ version=15
+ [[ 15 == \1 ]]
+ [[ 15 == \2 ]]
+ [[ 15 == \3 ]]
+ [[ 15 == \4 ]]
+ [[ 15 == \5 ]]
+ [[ 15 == \6 ]]
+ [[ 15 == \7 ]]
+ [[ 15 == \8 ]]
+ [[ 15 == \9 ]]
+ [[ 15 == \1\0 ]]
+ [[ 15 == \1\1 ]]
+ [[ 15 == \1\2 ]]
+ [[ 15 == \1\3 ]]
+ [[ 15 == \1\4 ]]
+ [[ '' == true ]]
+ gravity_CheckDNSResolutionAvailable
+ local lookupDomain=pi.hole
+ [[ ! -e /etc/pihole/local.list ]]
+ [[ -s /etc/pihole/local.list ]]
+ lookupDomain=raw.githubusercontent.com
+ timeout 4 getent hosts raw.githubusercontent.com
+ [[ -n '' ]]
+ timeout 4 dig +short raw.githubusercontent.com
+ [[ -n '' ]]
+ pgrep pihole-FTL
+ echo -e '  [✗] DNS resolution is currently unavailable'
+ secs=120
+ echo -ne '  [i] Time until retry: 120'
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 120 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 120'
+ : 120
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 119 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 119'
+ : 119
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 118 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 118'
+ : 118
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 117 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 117'
+ : 117
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 116 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 116'
+ : 116
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 115 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 115'
+ : 115
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 114 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 114'
+ : 114
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 113 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 113'
+ : 113
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 112 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 112'
+ : 112
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 111 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 111'
+ : 111
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 110 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 110'
+ : 110
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 109 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 109'
+ : 109
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 108 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 108'
+ : 108
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 107 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 107'
+ : 107
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 106 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 106'
+ : 106
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 105 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 105'
+ : 105
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 104 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 104'
+ : 104
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 103 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 103'
+ : 103
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 102 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 102'
+ : 102
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 101 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 101'
+ : 101
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 100 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 100'
+ : 100
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 99 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 99'
+ : 99
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 98 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 98'
+ : 98
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 97 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 97'
+ : 97
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 96 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 96'
+ : 96
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 95 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 95'
+ : 95
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 94 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 94'
+ : 94
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 93 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 93'
+ : 93
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 92 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 92'
+ : 92
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 91 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 91'
+ : 91
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 90 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 90'
+ : 90
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 89 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 89'
+ : 89
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 88 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 88'
+ : 88
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 87 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 87'
+ : 87
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 86 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 86'
+ : 86
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 85 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 85'
+ : 85
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 84 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 84'
+ : 84
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 83 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 83'
+ : 83
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 82 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 82'
+ : 82
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 81 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 81'
+ : 81
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 80 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 80'
+ : 80
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 79 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 79'
+ : 79
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 78 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 78'
+ : 78
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 77 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 77'
+ : 77
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 76 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 76'
+ : 76
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 75 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 75'
+ : 75
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 74 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 74'
+ : 74
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 73 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 73'
+ : 73
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 72 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 72'
+ : 72
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 71 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 71'
+ : 71
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 70 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 70'
+ : 70
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 69 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 69'
+ : 69
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 68 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 68'
+ : 68
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 67 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 67'
+ : 67
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 66 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 66'
+ : 66
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 65 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 65'
+ : 65
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 64 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 64'
+ : 64
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 63 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 63'
+ : 63
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 62 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 62'
+ : 62
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 61 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 61'
+ : 61
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 60 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 60'
+ : 60
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 59 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 59'
+ : 59
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 58 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 58'
+ : 58
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 57 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 57'
+ : 57
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 56 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 56'
+ : 56
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 55 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 55'
+ : 55
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 54 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 54'
+ : 54
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 53 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 53'
+ : 53
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 52 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 52'
+ : 52
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 51 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 51'
+ : 51
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 50 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 50'
+ : 50
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 49 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 49'
+ : 49
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 48 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 48'
+ : 48
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 47 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 47'
+ : 47
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 46 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 46'
+ : 46
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 45 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 45'
+ : 45
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 44 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 44'
+ : 44
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 43 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 43'
+ : 43
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 42 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 42'
+ : 42
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 41 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 41'
+ : 41
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 40 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 40'
+ : 40
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 39 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 39'
+ : 39
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 38 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 38'
+ : 38
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 37 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 37'
+ : 37
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 36 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 36'
+ : 36
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 35 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 35'
+ : 35
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 34 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 34'
+ : 34
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 33 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 33'
+ : 33
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 32 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 32'
+ : 32
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 31 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 31'
+ : 31
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 30 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 30'
+ : 30
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 29 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 29'
+ : 29
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 28 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 28'
+ : 28
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 27 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 27'
+ : 27
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 26 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 26'
+ : 26
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 25 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 25'
+ : 25
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 24 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 24'
+ : 24
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 23 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 23'
+ : 23
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 22 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 22'
+ : 22
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 21 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 21'
+ : 21
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 20 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 20'
+ : 20
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 19 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 19'
+ : 19
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 18 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 18'
+ : 18
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 17 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 17'
+ : 17
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 16 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 16'
+ : 16
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 15 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 15'
+ : 15
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 14 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 14'
+ : 14
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 13 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 13'
+ : 13
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 12 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 12'
+ : 12
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 11 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 11'
+ : 11
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 10 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 10'
+ : 10
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 9 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 9'
+ : 9
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 8 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 8'
+ : 8
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 7 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 7'
+ : 7
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 6 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 6'
+ : 6
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 5 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 5'
+ : 5
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 4 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 4'
+ : 4
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 3 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 3'
+ : 3
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 2 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 2'
+ : 2
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 1 -eq 0 ]]
+ echo -ne '\r  [i] Time until retry: 1'
+ : 1
+ sleep 1
+ timeout 1 getent hosts raw.githubusercontent.com
+ [[ 0 -eq 0 ]]
+ break
+ gravity_CheckDNSResolutionAvailable
+ local lookupDomain=pi.hole
+ [[ ! -e /etc/pihole/local.list ]]
+ [[ -s /etc/pihole/local.list ]]
+ lookupDomain=raw.githubusercontent.com
+ timeout 4 getent hosts raw.githubusercontent.com
+ [[ -n 0 ]]
+ echo -e '\r  [✗] DNS resolution is not available'
+ exit 1

after installing a text editor in the container (I know it will be removed)
I when in gravity.sh, it looks up pi.hole and raw.githubusercontent.com
for some reason pi.hole is not accessible though any device on the network but raw.githubusercontent.com redirects to github.com

.# If the /etc/resolv.conf contains resolvers other than 127.0.0.1 then the local dnsmasq will not be queried and pi.hole is NXDOMAIN.
. # This means that even though name resolution is working, the getent hosts check fails and the holddown timer keeps ticking and eventually fails

extracting the command being run "timeout 4 dig +short pi.hole" returns nothing and
"timeout 4 dig +short raw.githubusercontent.com" also returns nothing

removing the "timeout 4" gives "dig +short raw.githubusercontent.com" a reply but not pi.hole

why does it take my network longer than 4 seconds

the host system can dig it in less than a second

$ time dig +short raw.githubusercontent.com @192.168.1.252
185.199.111.133
185.199.108.133
185.199.109.133
185.199.110.133

real	0m0.029s
user	0m0.018s
sys	0m0.000s

but pi-hole

root@pi-hole:/# time dig +short raw.githubusercontent.com
185.199.108.133
185.199.111.133
185.199.109.133
185.199.110.133

real	0m4.061s
user	0m0.022s
sys	0m0.014s

This means that the Docker container would use the loopback address for DNS, i.e it is Pi-hole that would process the requests. Note that the host system's (in this case, the container's) DNS resolution does not affect your Pi-hole clients DNS resolution.
As per the comment in that resolv.conf, you could consider to edit that file and replace 127.0.0.11 with a public DNS server.

However, this usually wouldn't be required, with container resolution times on par with the host system (click for details of one of my Pi-hole containers).
root@8856f41bafcd:/# time dig +short raw.githubusercontent.com
185.199.111.133
185.199.110.133
185.199.109.133
185.199.108.133

real	0m0.134s
user	0m0.078s
sys	0m0.012s

So before you alter resolv.conf, let's see how Pi-hole handled that query.

Please rerun that dig from your container, and then share the output of:

pihole-FTL sqlite3 /etc/pihole/pihole-FTL.db "SELECT client, status, forward, reply_time FROM queries \
WHERE domain = 'raw.githubusercontent.com' \
AND timestamp > strftime('%s','now','-5 minutes');"

Edit: Pi-hole commits in-memory data to its query database every minute, so you may have to wait that long for the SQL query to return data.

1 Like

but raw.githubusercontent.com is not from a client, its from the container and seems to bypass pi-hole as there is no log of it in the web ui

root@pi-hole:/# time dig +short raw.githubusercontent.com
185.199.110.133
185.199.108.133
185.199.111.133
185.199.109.133

real	0m4.039s
user	0m0.007s
sys	0m0.008s
root@pi-hole:/# pihole-FTL sqlite3 /etc/pihole/pihole-FTL.db "SELECT client, status, forward, reply_time FROM queries \
WHERE domain = 'raw.githubusercontent.com' \
AND timestamp > strftime('%s','now','-5 minutes');"

that proves my point, the container is not using pi-hole

is 127.0.0.11 loopback? I though it was 127.0.0.1

changing to 127.0.0.1 and the dig was instant

root@pi-hole:/# time dig +short raw.githubusercontent.com
185.199.110.133
185.199.111.133
185.199.109.133
185.199.108.133

real	0m0.045s
user	0m0.022s
sys	0m0.012s

also after waiting a few minutes it was saved into the database

root@pi-hole:/# pihole-FTL sqlite3 /etc/pihole/pihole-FTL.db "SELECT client, status, forward, reply_time FROM queries \
WHERE domain = 'raw.githubusercontent.com' \
AND timestamp > strftime('%s','now','-5 minutes');"
127.0.0.1|2|1.1.1.1#53|0.0185
127.0.0.1|3||0.0002

so my question is now what generates or modifies resolv.conf

changing /opt/pihole/gravity.sh back to the original "timeout 4" as well now works and "pihole -g"

so what generates resolv.conf with "127.0.0.11" not 127.0.0.1 as when I regenerate/upgrade the container that change will be lost