Strange DNS behavior - fallback to other IP

Operating system: ubuntu
OS version: 20.04

ISSUE & Question:

I have a script (bot.php) which need to run curl requests at - which is managed at the same server (server2
Most of the time it works like expected and resolve to: to

But sometimes it resolves to to

If the wrong request is executed, Curl show, that the response came from port 9097, instead of Port 10050 - which is the Port if the request was resolved to the right IP.

I wonder why does the curl-request (only sometimes) fail and resolve to an wrong subdomain at the

The Setup / Enviroment

I’ve setup my Virtualmin-Server on a subdomain of an existing domain I still use (following is demo-data):

I use the DNS at server2 ( as primary nameserver for all the Domains I do manage with virtualmin.
For example there is an virtualserver named

The main-domain is managed by an external NS-Server.
Here are some example entries, how the Main-Domain is configured:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.