Broken Guide for Configuring DNS-Over-HTTPS on Pi-hole

Expected Behaviour:

I tried to follow the guide on Configuring DNS-Over-HTTPS on Pi-hole Redirecting...

Actual Behaviour:

But I get this error message

root@odroid:~# wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
--2019-08-14 17:51:06--  https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
Resolving bin.equinox.io (bin.equinox.io)... 34.196.237.103, 52.3.53.115, 52.21.103.149, ...
Connecting to bin.equinox.io (bin.equinox.io)|34.196.237.103|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12273421 (12M) [application/octet-stream]
Saving to: 'cloudflared-stable-linux-arm.tgz'

cloudflared-stable-linux-arm.t 100%[=================================================>]  11.70M  1.11MB/s    in 11s

2019-08-14 17:51:17 (1.10 MB/s) - 'cloudflared-stable-linux-arm.tgz' saved [12273421/12273421]

root@odroid:~# tar -xvzf cloudflared-stable-linux-arm.tgz
cloudflared
root@odroid:~# sudo cp ./cloudflared /usr/local/bin
root@odroid:~# sudo chmod +x /usr/local/bin/cloudflared
root@odroid:~# cloudflared -v
-bash: /usr/local/bin/cloudflared: No such file or directory

and later on another error:

root@odroid:~# dig @127.0.0.1 -p 5053 google.com

; <<>> DiG 9.11.3-1ubuntu1.8-Ubuntu <<>> @127.0.0.1 -p 5053 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

Seems to be okay:

dschaper@nanopineo:/tmp$ wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
--2019-08-14 17:05:52--  https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
Resolving bin.equinox.io (bin.equinox.io)... 35.172.177.65, 34.231.75.48, 52.207.111.186, ...
Connecting to bin.equinox.io (bin.equinox.io)|35.172.177.65|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12273421 (12M) [application/octet-stream]
Saving to: ‘cloudflared-stable-linux-arm.tgz’

cloudflared-stable-linux-arm. 100%[===============================================>]  11.70M  6.68MB/s    in 1.8s    

2019-08-14 17:05:54 (6.68 MB/s) - ‘cloudflared-stable-linux-arm.tgz’ saved [12273421/12273421]

dschaper@nanopineo:/tmp$ tar -xzvf cloudflared-stable-linux-arm.tgz 
cloudflared
dschaper@nanopineo:/tmp$ chmod +x cloudflared
dschaper@nanopineo:/tmp$ ./cloudflared -v
cloudflared version 2019.8.1 (built 2019-08-06-2142 UTC)
dschaper@nanopineo:/tmp$ sudo cp ./cloudflared /usr/local/bin
[sudo] password for dschaper: 
dschaper@nanopineo:/tmp$ cloudflared -v
cloudflared version 2019.8.1 (built 2019-08-06-2142 UTC)
dschaper@nanopineo:/tmp$ which cloudflared
/usr/local/bin/cloudflared

And why do I get the error messages and what can I do about it?

I don't know. What does which cloudflared show? And ls -la /usr/local/bin/cloudflared?

root@odroid:~# which cloudflared
/usr/local/bin/cloudflared
root@odroid:~# ls -la /usr/local/bin/cloudflared
-rwxr-xr-x 1 cloudflared cloudflared 26763536 Aug 14 18:02 /usr/local/bin/cloudflared
root@odroid:~#

It should be owned by the user that downloaded it. Try sudo chown root:root /usr/local/bin/cloudflared and then run the binary again.

That does not work either.

root@odroid:~# sudo chown root:root /usr/local/bin/cloudflared
root@odroid:~# cloudflared -v
-bash: /usr/local/bin/cloudflared: No such file or directory

What is your $PATH with that user?

And check the bash exe hash: type cloudflared and if it shows it is hashed then hash -d cloudflared to clear that. Then try just cloudflared by itself to see if the help is displayed.

$PATH shows also /usr/local/sbin so I tried to also copy ./cloudflared to the sbin folder but still not working. Operating system and version: Ubuntu 18.04.3 LTS
Running on Odroid-N2

root@odroid:~# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/loc
root@odroid:~# sudo cp ./cloudflared /usr/local/sbin
root@odroid:~# sudo chmod +x /usr/local/sbin/cloudflared
root@odroid:~# sudo chown root:root /usr/local/sbin/cloudflared
root@odroid:~# type cloudflared
cloudflared is hashed (/usr/local/bin/cloudflared)
root@odroid:~# hash -d cloudflared
root@odroid:~# cloudflared
-bash: /usr/local/sbin/cloudflared: No such file or directory
root@odroid:~# type cloudflared
cloudflared is hashed (/usr/local/sbin/cloudflared)
root@odroid:~# hash -d cloudflared
root@odroid:~# type cloudflared
cloudflared is /usr/local/sbin/cloudflared
root@odroid:~# hash -d /usr/local/sbin/cloudflared
root@odroid:~# type cloudflared
cloudflared is /usr/local/sbin/cloudflared
root@odroid:~# cloudflared -v
-bash: /usr/local/sbin/cloudflared: No such file or directory
root@odroid:~# cloudflared
-bash: /usr/local/sbin/cloudflared: No such file or directory

Does ./cloudflared work in the directory that you downloaded to?

root@odroid:~# ./cloudflared
-bash: ./cloudflared: No such file or directory

clpD221

There's something local to your system that is not configured correctly. This doesn't look like a Pi-hole guide issue since I've been able to download that same file and run it without any issues on a test system. You'll need to ask the creators of your operating system for assistance.

I found the cause

root@odroid:~# ldd ./cloudflared
        not a dynamic executable
root@odroid:~# file ./cloudflared
./cloudflared: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=48e253c54e7744b4c020fbdd06a155dadc2d0fdf, not stripped
root@odroid:~# uname -i
aarch64

Cloudflared is apparently programmed for 32-bit systems but I am running aarch64. Unfortunately, there is no 64 bit version of cloudflared around.

The error "No such file or directory" is probably referring to below 32 bit library not being installed:

pi@noads:~/tmp $ strings cloudflared | head -1
/lib/ld-linux-armhf.so.3

That one is part of the libc6 package:

pi@noads:~ $ dpkg -S /lib/ld-linux-armhf.so.3
libc6:armhf: /lib/ld-linux-armhf.so.3

If lucky, your distro's repository also holds the 32 bit armhf files and you can do below to get it installed:

sudo dpkg --add-architecture armhf

sudo apt-get update

sudo apt-get install libc6:armhf

If not lucky, you need to find other means to install that 32 bit ld-linux-armhf.so.3 library.
It should be possible to run the 32 bit cloudflared binary on your 64 bit system.

I followed those stops and get the following error message:

root@odroid:~# apt-get install libc6:armhf
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libc6:armhf is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  libdb1-compat tzdata

E: Package 'libc6:armhf' has no installation candidate

What distro/OS did you install ?

lsb_release -a

hostnamectl | tail -3

sudo grep -v '^#\|^$' -R /etc/apt/sources.list*

I had Armbian installed on an Odroid once and it used the official Debian repository that also holds armhf packages.
The Odroid wasnt mine so I didnt try installing Pi-hole.

root@odroid:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.3 LTS
Release:        18.04
Codename:       bionic
root@odroid:~# hostnamectl | tail -3
  Operating System: Ubuntu 18.04.3 LTS
            Kernel: Linux 4.9.187-53
      Architecture: arm64
root@odroid:~# sudo grep -v '^#\|^$' -R /etc/apt/sources.list*
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list:deb-src http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list:deb http://apt.syncthing.net/ syncthing release
/etc/apt/sources.list.d/syncthing.list.save:deb https://apt.syncthing.net/ syncthing stable
/etc/apt/sources.list.d/certbot-ubuntu-certbot-bionic.list:deb http://ppa.launchpad.net/certbot/certbot/ubuntu bionic main
/etc/apt/sources.list.d/certbot-ubuntu-certbot-bionic.list.save:deb http://ppa.launchpad.net/certbot/certbot/ubuntu bionic main
/etc/apt/sources.list.d/syncthing.list:deb https://apt.syncthing.net/ syncthing stable
/etc/apt/sources.list.d/odroid.list.save:deb http://deb.odroid.in/n2/ bionic main
/etc/apt/sources.list.d/odroid.list:deb http://deb.odroid.in/n2/ bionic main
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list.old:deb http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list.old:deb-src http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list.old:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list.old:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic universe
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
/etc/apt/sources.list.save:deb http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list.save:deb-src http://archive.canonical.com/ubuntu bionic partner
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe
/etc/apt/sources.list.save:deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list.save:deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse
/etc/apt/sources.list.save:deb http://apt.syncthing.net/ syncthing release

And below one just to be sure ?

arch

EDIT: never mind, its already displayed with the hostnamectl command.
Hold on I am looking for something.

I tried browsing through the ports.ubuntu.com repository but couldnt find the package.
You could try install below one:

sudo apt-get install apt-file

And use the command to search through the repo's defined in /etc/apt/sources.list*:

sudo apt-file update

apt-file search ld-linux-armhf.so.3

EDIT: ow and whats output for below ones now ?

dpkg --print-architecture

dpkg --print-foreign-architectures