Sponsored Content
Top Forums Shell Programming and Scripting How to convert forward zone file to reverse Post 302282347 by quirkasaurus on Friday 30th of January 2009 03:50:34 PM
Old 01-30-2009
The output data doesn't look right to me because the
lines:

10.20.30.40
40 PTR subdomain1.domain.com
41 PTR subdomain4.domain.com
42 PTR subdomain5.domain.com

don't look like they imply that the last 40 is substituted by the first field in subsequent lines.

At any rate -- here's my ksh solution (late)

Code:
 
prev_key=some-junk
 
cat << EOF |
subdomain1 A 10.20.30.40
subdomain2 A 10.20.31.41
subdomain3 A 10.20.35.43
subdomain4 A 10.20.30.41
subdomain5 A 10.20.30.42
EOF
#----------------------------------------------------------------------#
# Convert spaces to dots.                                              #
#----------------------------------------------------------------------#
sed -e's/ /./g' |
#----------------------------------------------------------------------#
# Delimit on dots... reformat so that the key is in front...           #
#----------------------------------------------------------------------#
awk -F. '{
  printf( "%s.%s.%s %s %s\n", $3, $4, $5, $6, $1 );
  }' |
while read key subnet domain; do
 
  if [[ $key != $prev_key ]]; then
    print $key
    prev_key=$key
  fi
 
  print $subnet PTR $domain.domain.com
 
done

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

.forward file for mail redirection

I've set up a .forward file on a few identical servers that we have (all identical .forward file as well) but only one server is forwarding any of my unix mail (mail generated by cron) to my internet account. Because these servers (5) are all identical in terms of aix versions, etc., I do not... (3 Replies)
Discussion started by: giannicello
3 Replies

2. Shell Programming and Scripting

delete and move number forward..in file

I have a file, can I just modify the <number> field and delete the 3rd number and move 4th number to 3rd.. (surely, delete the last digit)? <john> <Number>11 20 03 22 23 21 91 00 F0</Number> <peter> <Number>12 20 03 20 99 21 91 20 F0</Number> <ken> <id> <Number>10 21 03 21 78 21 92... (6 Replies)
Discussion started by: happyv
6 Replies

3. Solaris

Bind zone transfer recategorises zone file?

Hi, I have a primary/slave Bind 9 setup running on a Solaris 10 platform. Everything is hunky dorey, except for when I make a zone file change and up the serial the file that is transferred to the slave looses all its comments, and the entries are place in alphabetical order. I administer many... (1 Reply)
Discussion started by: fulhamfcboy
1 Replies

4. UNIX for Advanced & Expert Users

Forward/Reverse Hostname Resolution for Oracle Install

I've got an old v880 running Sol10 that is going to another location. When the system moves, the domainname in resolv.conf will change also. My DBA's are going through the steps of installing Oracle on the box and they want the install program to resolve the hostname is if the box were already in... (2 Replies)
Discussion started by: bluescreen
2 Replies

5. UNIX for Dummies Questions & Answers

DNS forward and reverse entry required thorugh scripting instead of manually done

HI GUrus, I am very mcuh new for this forum ....i need you all guys help for resolving my queries. As i have DNS server , platform is sunsolaris----8. We are using that serevr for resolving all network nodes. I am going to explain the process what i am following .... I could have... (2 Replies)
Discussion started by: leenagoyal
2 Replies

6. Shell Programming and Scripting

Convert hex to decimal or reverse is better?

Please Help Me! about the problem down under. I have 2 files with nearly the same characteristics, I have to convert one to the other format or the other format to one's format. I want to write it with awk. The first file contain lines like this: 300000001#A#Y#Y#Y#Y The other file contain... (4 Replies)
Discussion started by: Axel82
4 Replies

7. Solaris

Zone failes to boot due to mount issue, dir exists in zone.

I have two physical servers, with zones that mount local storage. We were using "raw device" in the zonecfg to point to a metadevice on the global zone (it was not mounted in the global zone at any point). It failed to mount on every boot because the directory existed in the zone. I... (6 Replies)
Discussion started by: BG_JrAdmin
6 Replies

8. Ubuntu

Iptables forward traffic to forward chain!!!

Hi, I am new to linux stuff. I want to use linux iptables to configure rule so that all my incoming traffic with protocol "tcp" is forwarded to the "FORWARD CHAIN". The traffic i am dealing with has destination addresss of my machine but i want to block it from coming to input chain and somehow... (0 Replies)
Discussion started by: arsipk
0 Replies

9. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies
Mail::SPF::Mech::PTR(3) 				User Contributed Perl Documentation				   Mail::SPF::Mech::PTR(3)

NAME
Mail::SPF::Mech::PTR - SPF record "ptr" mechanism class DESCRIPTION
An object of class Mail::SPF::Mech::PTR represents an SPF record mechanism of type "ptr". Constructors The following constructors are provided: new(%options): returns Mail::SPF::Mech::PTR Creates a new SPF record "ptr" mechanism object. %options is a list of key/value pairs representing any of the following options: qualifier domain_spec See "new" in Mail::SPF::Mech. new_from_string($text, %options): returns Mail::SPF::Mech::PTR; throws Mail::SPF::ENothingToParse, Mail::SPF::EInvalidMech Creates a new SPF record "ptr" mechanism object by parsing the string and any options given. Class methods The following class methods are provided: default_qualifier qualifier_pattern See "Class methods" in Mail::SPF::Mech. name: returns string Returns 'ptr'. name_pattern: returns Regexp Returns a regular expression that matches a mechanism name of 'ptr'. Instance methods The following instance methods are provided: text qualifier params stringify See "Instance methods" in Mail::SPF::Mech. domain_spec: returns Mail::SPF::MacroString Returns the "domain-spec" parameter of the mechanism. match($server, $request): returns boolean Checks whether the mechanism's target domain name, or a sub-domain thereof, is a "valid" domain name for the given request's IP address (see "ip_address" in Mail::SPF::Request), and returns true if it does, or false otherwise. See "valid_domain_for_ip_address" in Mail::SPF::Util for how domains are validated. See RFC 4408, 5.5, for the description of an equivalent algorithm. SEE ALSO
Mail::SPF, Mail::SPF::Record, Mail::SPF::Term, Mail::SPF::Mech <http://www.ietf.org/rfc/rfc4408.txt> For availability, support, and license information, see the README file included with Mail::SPF. AUTHORS
Julian Mehnle <julian@mehnle.net>, Shevek <cpan@anarres.org> perl v5.12.1 2010-07-05 Mail::SPF::Mech::PTR(3)
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy