Operating system: ubuntu
OS version: 20.04
ISSUE & Question:
I have a script (bot.php) which need to run curl
requests at api.superservice.com
- which is managed at the same server (server2 12.12.12.12).
Most of the time it works like expected and resolve to:
api.superservice.com to 12.12.12.12
.
But sometimes it resolves to
api.superservice.com.mydomain.com to 1.1.1.1
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 mydomain.com
-Domain.
The Setup / Enviroment
I’ve setup my Virtualmin-Server on a subdomain of an existing domain I still use (following is demo-data):
- server2.mydomain.com : 12.12.12.12
I’ve also setup this domain (server2.mydomain.com) as Virtualmins “Host default Domain”:I use the DNS at server2 (12.12.12.12) as primary nameserver for all the Domains I do manage with virtualmin.
For example there is an virtualserver namedapi.superservice.com
The main-domain
mydomain.com
is managed by an external NS-Server.
Here are some example entries, how the Main-Domain is configured:
- server3.mydomain.com IN A 13.13.13.13
- server4.mydomain.com IN A 14.14.14.14
- mydomain.com IN A 1.1.1.1
- *.mydomain.com IN A 1.1.1.1