A single DNS request ASCII code 126 shows my home folder as DNS request

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 as dig $HOME (expanding the variable into the path).
  • dig "~" (or dig '~') will be executed as dig '~' and will try to query this domain: ~.