LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-08-2014, 02:04 PM   #1
amit.kanade1983
Member
 
Registered: May 2012
Location: India
Distribution: CentOS,RedHat
Posts: 41

Rep: Reputation: 1
dig utility does not return any answer for CNAME record


Hi,
I have a CNAME alias in my forward zone as follows...




$TTL 86400
@ IN SOA master-dns.example.com. root.example.com. (
102408 ;serial
3600 ;refresh after 6 hours
1800 ;retry after 1 hour
604800 ;expire after 1 week
86400 ) ;minimum TTL of 1 day
;
IN NS master-dns.example.com.
IN NS slave-dns.example.com.
@ IN A 192.168.88.135
slave-dns IN A 192.168.88.129
master-dns IN A 192.168.88.135
kakarott IN A 192.168.88.130
www2.example.com IN CNAME master-dns

When I do "dig www2.example.com" the output is...

[root@slave-dns slaves]# dig www2.example.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> www2.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 28074
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;www2.example.com. IN A

;; AUTHORITY SECTION:
example.com. 86400 IN SOA master-dns.example.com. root.example.com. 102408 3600 1800 604800 86400

;; Query time: 3 msec
;; SERVER: 192.168.88.129#53(192.168.88.129)
;; WHEN: Wed Apr 9 00:31:58 2014
;; MSG SIZE rcvd: 86


Why does it not respond with an IP address???
 
Old 04-08-2014, 03:15 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,827

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Hi,
Quote:
<snip>
www2.example.com IN CNAME master-dns
You miss the trailing dot after www2.example.com. Add it
Code:
<snip>
www2.example.com. IN CNAME master-dns
increase the serial, reload and try again

Regards
 
1 members found this post helpful.
Old 04-08-2014, 03:19 PM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@amit.kanade1983

As I can see from your output it says that it restored 0 answers. As you have setup CNAME try out this way:

dig master-dns.example.com, it should return both A record value of this CNAME as well as IP of the host.
 
Old 04-09-2014, 10:10 AM   #4
amit.kanade1983
Member
 
Registered: May 2012
Location: India
Distribution: CentOS,RedHat
Posts: 41

Original Poster
Rep: Reputation: 1
I have already tried "dig master-dns.example.com". it doesnt show any CNAME record in Answer section. But I'll try the fix suggested by bathory. Will, update soon.
 
Old 04-11-2014, 11:04 AM   #5
amit.kanade1983
Member
 
Registered: May 2012
Location: India
Distribution: CentOS,RedHat
Posts: 41

Original Poster
Rep: Reputation: 1
Hi,
I did the setting as suggested by bathory and it worked.

www2.example.com. IN CNAME master-dns

Output of "dig www2.example.com"

[root@master-dns ~]# dig www2.example.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> www2.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 28011
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;www2.example.com. IN A

;; ANSWER SECTION:
www2.example.com. 86400 IN CNAME master-dns.example.com.
master-dns.example.com. 86400 IN A 192.168.88.135

;; AUTHORITY SECTION:
example.com. 86400 IN NS master-dns.example.com.
example.com. 86400 IN NS slave-dns.example.com.

;; ADDITIONAL SECTION:
slave-dns.example.com. 86400 IN A 192.168.88.129

;; Query time: 0 msec
;; SERVER: 192.168.88.135#53(192.168.88.135)
;; WHEN: Fri Apr 11 21:33:25 2014
;; MSG SIZE rcvd: 129



Thanks buddy...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] dig does not return answer section-- Please reply deepak_message Linux - Server 15 01-16-2012 04:03 AM
Tracing DNS with dig - how to follow CNAME? Skaperen Linux - Software 11 12-17-2011 05:17 PM
No Answer with DIG amplifire Linux - Server 2 05-18-2009 07:58 AM
How do I set up a CNAME record? SimbaSpirit Linux - Software 1 02-28-2008 07:01 AM
why To Use CNAME record ???? srnerkar1 Linux - Networking 3 12-31-2005 12:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration