LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-22-2012, 04:26 AM   #1
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Rep: Reputation: 1
Collect record information in Linux DNS


Suppose i have created a record in DNS i.e. station1.example.com and creates 5 CNAME record which is associated with this record.

So if i want to take information about station1.example.com then it should give all details which is associated with this name like CNAME.

So what command i can use to see the information.


Regards
Sandeep Sharma
 
Old 02-22-2012, 05:26 AM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

I don't think you can do that,
but take a look at some DIG example to try out different options.
 
Old 02-22-2012, 05:39 AM   #3
eosbuddy
Member
 
Registered: Feb 2012
Location: India
Distribution: Ubuntu, Fedora, Gentoo, Mandrake, RedHat, CentOs
Posts: 30

Rep: Reputation: Disabled
dig @<name-server> CNAME station1.example.com

(substitute the name-server domain name)
 
Old 02-22-2012, 06:26 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Code:
dig any station1.example.com
 
Old 02-22-2012, 06:28 AM   #5
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
Both dig commands are not giving required output.
 
Old 02-22-2012, 06:54 AM   #6
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
Only option that i am seeing here is that through DNS config, we can collect detail of records by using utility like grep.
 
Old 02-22-2012, 07:09 AM   #7
eosbuddy
Member
 
Registered: Feb 2012
Location: India
Distribution: Ubuntu, Fedora, Gentoo, Mandrake, RedHat, CentOs
Posts: 30

Rep: Reputation: Disabled
You will surely need to process the output with awk and grep.

e.g:
Code:
dig @<nameserver> CNAME station1.example.com |grep "station1.example.com. .*[0-9]" |awk '{ print $5}'

Last edited by eosbuddy; 02-22-2012 at 07:29 AM.
 
Old 02-22-2012, 12:36 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

Quote:
Originally Posted by sandeep_hello View Post
Only option that i am seeing here is that through DNS config, we can collect detail of records by using utility like grep.
Another way is to run the following from a host that is allowed to do AXFRs:
Code:
dig axfr example.com |grep station1.example.com
Regards
 
Old 02-22-2012, 11:39 PM   #9
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
This command is also useful but mentioned command can be run on slave DNS server only if i am not wrong.
 
Old 02-23-2012, 12:25 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by sandeep_hello View Post
This command is also useful but mentioned command can be run on slave DNS server only if i am not wrong.
Not necessarily. As I've said above it can be run from a host that is allowed to do zone transfers. Usually this is indeed another dns (primary or secondary) authoritative for that zone, but you can allow-transfer for whatever host you want.

Regards
 
  


Reply



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



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

All times are GMT -5. The time now is 10:28 AM.

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