The issue is probably in your program.
The ASCII character 126 is ~
,
Your program is expanding ~
into /home/nextcloud
and querying something like dig /home/nextcloud
.
Fix your program to not use bash expansion.
Edit:
Just to explain better:
dig ~
will be executed asdig $HOME
(expanding the variable into the path).dig "~"
(ordig '~'
) will be executed asdig '~'
and will try to query this domain:~
.