# Dead.letter for root after system boot / Could not resolve host: github.com

**URL:** <https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211>\
**Category:** Community Help\
**Created:** [July 13, 2024, 3:59pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211 "2024-07-13T15:59:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 3:59pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/1 "2024-07-13T15:59:16Z")

</div>

When I boot my PI afterwards I do have dead.letter file for root with following content:

```auto
fatal: unable to access 'https://github.com/pi-hole/pi-hole/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/pi-hole/web/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/pi-hole/FTL/': Could not resolve host: github.com

```

github and all other DNS resolution works fine afterwards, seems network is not available during check time of updates?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [July 13, 2024, 5:03pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/2 "2024-07-13T17:03:35Z")

</div>

When your reboot your Pi, it takes a bit of time for all the apps and services to start (including Pi-hole). Try this experiment:

- Reboot the Pi.
- `pihole -status`
- `dig github.com @127.0.0.1`

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 5:30pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/3 "2024-07-13T17:30:20Z")

</div>

> [@jfb](#):
>
> dig github.com @127.0.0.1

```auto
pi@pihole:[~] $ pihole status
  [✓] FTL is listening on port 53
     [✓] UDP (IPv4)
     [✓] TCP (IPv4)
     [✓] UDP (IPv6)
     [✓] TCP (IPv6)

  [✓] Pi-hole blocking is enabled
pi@pihole:[~] $ dig github.com @127.0.0.1

; <<>> DiG 9.18.24-1-Raspbian <<>> github.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16652
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;github.com. IN A

;; ANSWER SECTION:
github.com. 1583 IN A 140.82.121.3

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Sat Jul 13 19:30:12 CEST 2024
;; MSG SIZE rcvd: 55

```

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 5:28pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/4 "2024-07-13T17:28:46Z")

</div>

```auto
pi@pihole:[~] $ pihole status
[✓] FTL is listening on port 53
[✓] UDP (IPv4)
[✓] TCP (IPv4)
[✓] UDP (IPv6)
[✓] TCP (IPv6)

[✓] Pi-hole blocking is enabled
pi@pihole:[~] $ dig github.com @127.0.0.1

; <<>> DiG 9.18.24-1-Raspbian <<>> github.com @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 647
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;github.com. IN A

;; ANSWER SECTION:
github.com. 1746 IN A 140.82.121.3

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1) (UDP)
;; WHEN: Sat Jul 13 19:27:29 CEST 2024
;; MSG SIZE rcvd: 55

```

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [July 13, 2024, 5:46pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/5 "2024-07-13T17:46:02Z")

</div>

These are the expected results. Pi-hole is running and correctly resolving the requested domain.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 6:02pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/6 "2024-07-13T18:02:13Z")

</div>

seems NW is not available at the time pihole checks for updates  
Should there be a sleep in the FTL service file?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [July 13, 2024, 6:16pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/7 "2024-07-13T18:16:47Z")

</div>

> [@Max-Mustermann](#):
>
> When I boot my PI afterwards I do have dead.letter file

Hmm, `dead.letter` is a file created by some email clients under certain circumstances, e.g. if you abort editing an email via Ctrl + C.

I'm unsure how Pi-hole would be involved here.  
Did you perhaps configure to be alerted of system failures via email?

And did you check when that file was actually created?  
If that's weeks ago, we may be hunting a red herring.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 6:18pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/8 "2024-07-13T18:18:29Z")

</div>

yes, it is created during boot/startup process, I did serveral reboots

> Did you perhaps configure to be alerted of system failures via email?

no, alterting doing not via email, I am using go-sendxmpp mainly

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [July 13, 2024, 6:43pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/9 "2024-07-13T18:43:59Z")

</div>

I suspect your alerting system loads prior to Pi-hole.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 13, 2024, 7:05pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/10 "2024-07-13T19:05:05Z")

</div>

I also checked the FTL.service, there is a pre-hook but nothing related to sleep or similar, also the network target is a requirement, so I out of ideas ....

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 14, 2024, 4:56pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/11 "2024-07-14T16:56:23Z")

</div>

> [@Max-Mustermann](#):
>
> ```auto
> fatal: unable to access 'https://github.com/pi-hole/pi-hole/': Could not resolve host: github.com
> fatal: unable to access 'https://github.com/pi-hole/web/': Could not resolve host: github.com
> fatal: unable to access 'https://github.com/pi-hole/FTL/': Could not resolve host: github.com
> 
> ```

not my alterting system, its the std. pihole check for new/updated versions:

```auto
fatal: unable to access 'https://github.com/pi-hole/pi-hole/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/pi-hole/web/': Could not resolve host: github.com
fatal: unable to access 'https://github.com/pi-hole/FTL/': Could not resolve host: github.com

```

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [July 14, 2024, 6:51pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/12 "2024-07-14T18:51:21Z")

</div>

You said this happens on boot.

Apparently the issue is: a cronjob (or something else) is trying to update Pi-hole before the network is available.

Also, the `dead.letter` file seems to be the result of a failed attempt to send an email (generated by your alerting system, because Pi-hole doesn't generate emails).

This is an OS level issue. The network is not ready when these services are trying to use it.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 14, 2024, 7:24pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/13 "2024-07-14T19:24:08Z")

</div>

I do have no crontab job setup manually to check github for pihole updates , is there such a check done by pihole? of so where is the github call script located?

---

<div class="post-metadata">

**Author:** ![rdwebdesign](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/rdwebdesign/32/51363_2.png) [@rdwebdesign](https://discourse.pi-hole.net/u/rdwebdesign)\
**Post date:** [July 14, 2024, 7:40pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/14 "2024-07-14T19:40:06Z")

</div>

Pi-hole has a cronjob to check for updates ([see here](https://github.com/pi-hole/pi-hole/blob/be5a8dc51a7b3e7ec3b40a9c815dee1c866ea2d4/advanced/Templates/pihole.cron#L33)), but your issue is your network is not available when this cronjob runs.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 14, 2024, 8:14pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/15 "2024-07-14T20:14:44Z")

</div>

Running as root cronjob? Havent found for User pi, or running as pihole? No clue?  
How can I assure that nw is available while update checking during reboot?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [July 15, 2024, 3:00am UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/16 "2024-07-15T03:00:28Z")

</div>

Why are you adding a check for update on each boot? Pi-hole checks for updates while running.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 15, 2024, 4:47am UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/18 "2024-07-15T04:47:20Z")

</div>

@jfb I havent added anything manually, it is left unchanged, so how can it be adjusted to not check after reboot? The reboot check is done in std cron for pihole setup in /etc/cron.d/pihole:

pi@pihole:[/etc/cron.d] $ cat pihole | grep reboot  
@reboot root /usr/sbin/logrotate --state /var/lib/logrotate/pihole /etc/pihole/logrotate  
@reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker reboot

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [July 15, 2024, 5:33pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/19 "2024-07-15T17:33:32Z")

</div>

Without knowing what process is creating that `dead.letter` file, it will be difficult to further analyse your issue.

It is unclear what state the network was actually in when whatever process wrote information to that `dead.letter` email.

The lines that show in that email just show failures to access remote hashes from `https://github.com/pi-hole/<component-repo>/`.

But [Pi-hole's update check](https://github.com/pi-hole/pi-hole/blob/be5a8dc51a7b3e7ec3b40a9c815dee1c866ea2d4/advanced/Scripts/updatecheck.sh#L80) would do so only after already having tried to access remote versions from `https://api.github.com/repos/pi-hole/<component-repo>//...` - and we do not see any complaints about those in your `dead.letter`:

In any case, you won't lose any important functionality when those resources are not accessible during an updatecheck after reboot.

Pi-hole regularly checks its core, web and FTL repositories for updates daily as well as upon reboot (in the latter case, it would wait for 30 seconds after being triggered before accessing the remote repositories, to allow the network stack to come up).

Granted, it's still irritating that you don't know what process is writing to `dead.letter`, and why.

---

<div class="post-metadata">

**Author:** ![Max-Mustermann](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/max-mustermann/32/35872_2.png) [@Max-Mustermann](https://discourse.pi-hole.net/u/Max-Mustermann)\
**Post date:** [July 15, 2024, 6:26pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/20 "2024-07-15T18:26:36Z")

</div>

@Bucking_Horn thanks for the deep and profound answer! I did some testing and the solution to avoid the dead.letter is:  
/etc/cron.d/pihole:  
comment out the updatechecker **@reboot** time  
**#** @reboot root PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker reboot

So, it is proven that the creation of the dead.letter is caused by the cron.d pihole script.

I did several tests, but I didn't manage to handle it with the "sleep 30" command.  
Not sure, how a "sleep 30" command does appropriate fit into the shell script line, I didn't manage that, so I have chosen the "hard way".

Any recommendations in how-to implement the sleep there would be more than welcome, also maybe I am not the only one with the dead.letter problem and the pihole cron.d script could be changed from the pihole development side as a fix.

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [July 15, 2024, 6:47pm UTC](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211/21 "2024-07-15T18:47:30Z")

</div>

Some process yet unknown is monitoring your logs and under certain unknown conditions then may try to create an email with excerpts of those logs.

Commenting out Pi-hole's reboot cron job just removes the trigger for whatever process is creating that `dead.letter` file.

Pi-hole does not create it (and you are the first user to report that file to contain Pi-hole related messages).

> [@Max-Mustermann](#):
>
> Any recommendations in how-to implement the sleep there would be more than welcome

Not sure what you are trying to do?  
As explained, the update check already sleeps for 30 seconds on reboot.  
And your earlier dig results show no issues with github.com when your system is up.

[Next page](https://discourse.pi-hole.net/t/dead-letter-for-root-after-system-boot-could-not-resolve-host-github-com/71211.md?page=2)
