Today I was shocked when checking where the staging domain of my website was actually pointing to. I was assuming by some sloppy configuration of either the domain or our company network, my stage-Domain somehow pointed to the production server.
So I typed host http://stage.***.com
and got 212.##.##.70 => Booom, the production server.
Afterwards, I tried host stage.***.com
and got 212.#.##.73 => Whew, the staging server
So, my question is: How can it happen, that accidentally pasting the "http://" into the commandline makes "host" return another IP address?
Edit: Since it seems unclear what I'm asking, I'm trying to clarify: As Sven Points out in his comment,
host http://stage.***.com
shouldn't return anything, but in my case it DOES return
http://stage.***.com has address 212.##.##.70
which is actually the IP of ***.com (production) So I would like to know how this could happen.
- why does it return the Prod-IP?
- Considering Sven's comment, why does it return anything at all? Since the actual answer was pretty misleading I would have preferred an error message. The "http://" was a copy/paste mistake anyway
By the way, I'm on a Ubuntu 16.10. client
Edit2:
; <<>> DiG 9.10.3-P4-Ubuntu <<>> http://stage.***.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26978
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 5
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;http://stage.***.com. IN A
;; ANSWER SECTION:
http://stage.***.com. 180 IN A 212.48.122.70
;; AUTHORITY SECTION:
***.com. 65 IN NS auth2.###.de.
***.com. 65 IN NS auth1.###.de.
;; ADDITIONAL SECTION:
auth1.###.de. 180 IN A 212.##.##.53
auth1.###.de. 180 IN AAAA 2a00:####:##:##::2
auth2.###.de. 180 IN A 212.##.##.53
auth2.###.de. 180 IN AAAA 2a00:####:##:##::2
Hmm. I guess the "http://" part is considered part of the domain and our DNS config says *.***.com has ###.70 ??? (So we have a wildcard for anything that is not stage....)