Can I use CNAME with ip address? Why If works (sometimes)?

Posted by Maciek Sawicki on Server Fault See other posts from Server Fault or by Maciek Sawicki
Published on 2012-04-09T21:00:47Z Indexed on 2012/04/09 23:33 UTC
Read the original article Hit count: 280

Filed under:

I believe that the easiest answer for the first question is "No, You have "A" for this", but I accidentally setup some subdomain using CNAME pointing to ip address and it worked on few computers in my office. I wonder how it was possible?

Now, when I'm checking it from home I have following error:

beast:~ viroos$ host somesubdomain.somedomain.com
Host somesubdomain.somedomain.com not found: 3(NXDOMAIN)

I'm 100% it used to work at my office (currently it looks like it doesn't, but I'm checking it on different machine). Therefore I'm not 100% if it worked due to some special network setup or because I tested it just after adding DNS entry.

I know this story sounds, a little crazy/incredibly, but can someone help me solve this puzzle.

//edit: I'm adding dig output

; <<>> DiG 9.6-ESV-R4-P3 <<>> somesubdomain.somedomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 60224
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;somesubdomain.somedomain.com.      IN  A

;; ANSWER SECTION:
somesubdomain.somedomain.com.   67  IN  CNAME   xxx.xxx.xxx.xx1.

;; AUTHORITY SECTION:
.           1800    IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2012040901 1800 900 604800 86400

;; Query time: 72 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Tue Apr 10 00:11:01 2012
;; MSG SIZE  rcvd: 136

© Server Fault or respective owner

Related posts about dns