I encounter strange DNS resolutions. Since a few weeks, I encounter errors in different systems that a related to a strange DNS resolutions.
I did some dig
on my machine and it resulted to a totally wrong results.
My DNS records looks like this:
Type | Domain | Value | Priority |
---|---|---|---|
NS | example.com |
pam.ns.Cloudflare.com. |
|
NS | example.com |
carl.ns.Cloudflare.com.. |
|
MX | example.com |
mail.corporate-company.com |
1 |
CNAME | subdomain.example.com |
example.com |
|
MX | subdomain.example.com |
mxa.mailgun.org |
10 |
MX | subdomain.example.com |
mxb.mailgun.org |
10 |
Here is the WRONG answer:
Instead of getting the MX of the subdomain, I get the record of the main domain!
$ dig @1.1.1.1 subdomain.example.com MX
; <<>> DiG 9.10.6 <<>> @1.1.1.1 subdomain.example.com MX
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32070
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;subdomain.example.com. IN MX
;; ANSWER SECTION:
subdomain.example.com. 0 IN CNAME example.com.
example.com. 298 IN MX 1 mail.corporate-company.com.
;; Query time: 3 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Oct 10 15:25:28 CEST 2018
;; MSG SIZE rcvd: 91
Not a minute later, I retried the exact same command and I get the RIGHT answer…
$ dig @1.1.1.1 subdomain.example.com MX
; <<>> DiG 9.10.6 <<>> @1.1.1.1 subdomain.example.com MX
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2555
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;subdomain.example.com. IN MX
;; ANSWER SECTION:
subdomain.example.com. 300 IN MX 10 mxb.mailgun.org.
subdomain.example.com. 300 IN MX 10 mxa.mailgun.org.
;; Query time: 4 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Oct 10 15:25:32 CEST 2018
;; MSG SIZE rcvd: 99
Anybody have an idea of what is happening ?
Thanks!