Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need help in writing shell script Post 302848247 by VKIRUPHAKARAN on Wednesday 28th of August 2013 10:34:05 PM
Old 08-28-2013
Need help in writing shell script

Dear Team,

Below is the list of steps i need to perform manually as of now and completely new to shell scripting, could you help in writing a shell script to perform the below procedure?






1. Log in to primary DNS server
2. Check /etc/named.conf if zone is already created (grep –i 10.0.11 named.conf)
Eg: if want to add server 10.0.11.13 in to DNS
Code:
zone "11.0.10.in-addr.arpa" in {
type master;
file "db.10.0.11";
};

3. If zone is already there go to /var/named
4. Then add server entry in file db.10.0.11
EG: 13 IN PTR servername.fg.net. And modify the serial number to yyyymmdd as below highlighted.
Suppose if entry is made on 20th November enter the serial number as 20111120
Code:
root@PDNS1A101 # cat db.10.0.99
$TTL 5h
;SOA rec
99.0.10. in-addr.arpa. IN SOA PDNS1A101.fg.net. root.PDNS1A101.fg.net. ( 20090101; serial number ( you should change to 20111120)
10800; refresh every 3 hours
10800; retry every 3 hours
604800; expire after a week
86400) ; TTL of 1 day
; Name Servers
99.0.10.in-addr.arpa. IN NS PDNS1A101.fg.net.
;Pointer records for 10.0.99

11 IN PTR PSPROA167.fg.net.
12 IN PTR PSPROD055.fg.net.
5. Add entry in db.fg.net (please change serial number here also)
6. Restart dns service -- svcadm restart dns/server

Moderator's Comments:
Mod Comment edit by bakunin: we asked you (in fact several times) to use CODE-tags. What made you think we won't care if you don't? Please use them, we really man it. Thanks.

Last edited by bakunin; 08-29-2013 at 12:08 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help with writing shell script

I have the following output. I want to write a script to check for 1. waits > 0 on all rowsand Ratio > .0. if true then send email. ========================= ROLLBACK SEGMENT CONTENTION ========================= If any ratio is > .01 then more rollback segments are needed NAME ... (1 Reply)
Discussion started by: jigarlakhani
1 Replies

2. UNIX for Dummies Questions & Answers

Writing a shell Script

How to write a shell script file to read 5 numbers using a while loop. Finding the average, maximum and minumum for the numbers. Any help would be great. (1 Reply)
Discussion started by: Chin
1 Replies

3. Shell Programming and Scripting

Need help for writing shell script

Hello ALL, I am fresher in Unix . i need help to write small shell script . Please help me unix guru. I am developing the internal site in my office . the data files are generated in one directory everyday . I have to write shell script to sort those files and put it is internal site . ... (3 Replies)
Discussion started by: deepa20
3 Replies

4. AIX

Difference between writing Unix Shell script and AIX Shell Scripts

Hi, Please give me the detailed Differences between writing Unix Shell script and AIX Shell Scripts. Thanks in advance..... (0 Replies)
Discussion started by: haroonec
0 Replies

5. Shell Programming and Scripting

Writing shell script

Hi, I am a new for shell script. i need to write script using the following commands cd /usres/test # create directory mkdir temp+DATE( i need to append date ) #moving files from one directory to this directory(we need to check total files in source and taget) cd /users/sample ... (2 Replies)
Discussion started by: bmkreddy
2 Replies

6. Shell Programming and Scripting

Need help in writing the shell script

Can anyone please help me in writing a shell script that would check if a particular user(xyz) has logged in, and if yes, the audit daemon needs to be started. When the user logs off the dameon needs to shutdown , and the report needs to be e-mailed to a set of users. (12 Replies)
Discussion started by: ggayathri
12 Replies

7. UNIX and Linux Applications

Need help in writing shell script

I have written a shell script and when i ran the script,for some point of time it is asking to press enter key manually using keyboard.So i need it the enter key in shell itself. ex : in my shell script,i used the command ssh-keygen -t rsa so it asks the enter 3 times. can you please let me know... (3 Replies)
Discussion started by: lkeswar
3 Replies

8. Shell Programming and Scripting

Writing a shell script

Hi I have two files a.log and b.log . i need to append a.log and b.log so that at the end of first line in a.log i need the append the data of first line from b.log and end of the second line in a.log i need to append the data of second line from b.log and so on up to the end of the file can... (3 Replies)
Discussion started by: lalu
3 Replies

9. Shell Programming and Scripting

Need help writing shell script!

Hi, I'm very new to this, so bear with me please. I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (2 Replies)
Discussion started by: ShiGua
2 Replies

10. UNIX for Dummies Questions & Answers

Need help writing shell script!

Hi, I'm very new to this, so bear with me please. I want to write a sh script (or if there's a better format please let me know) that allows me to, when I run it, print the date to a file (1.out) take 2 arguments (files a.fa and b.fa), run them with another program, outputting to 2.out, and then... (4 Replies)
Discussion started by: ShiGua
4 Replies
CSV1(5) 							 MaraDNS reference							   CSV1(5)

NAME
csv1 - Format of the csv1 zone file that MaraDNS uses SPECIAL NOTE
The csv1 zone file format is supported primarily for MaraDNS users who already have zone files in the csv1 format. MaraDNS now supports a csv2 zone file format. Note that the csv1 zone file format will continue to function as long as I am MaraDNS' maintainer. SPECIAL CHARACTERS
| This delimits fields # This signifies a comment. Lines starting with this are ignored, otherwise it has no significance % This, in domain names, signifies that the rest of the domain name should be the name of this zone * This is translated to mean "any host name that otherwise does not resolve". It must be at the beginning of a domain name. This is used as an escape character, either to escape octal values such as '45' for %, or to escape the '%' character so it has no special meaning, or to escape the backslash character. NOTES ON PROCESSING
All domain-name labels are converted to their lower-case equivalents before processing is done. This is because domain-name literals in the database with one or more upper-case letters in them are case-sensitive. This is my way to resolve RFC1035 schizophrenic desire to both allow binary domain labels, and its desire to be case-insensitive. The file must first have a SOA record, followed by one or more NS records, followed by other records. The initial NS and SOA records must be RR for this zone. NS records after any non-NS record must be part of another zone. The resolution algorithm will not break if non-CNAME records share records with a CNAME record, but this is not a good idea to do. RR FORMAT
A domain name is a one-letter designation of its type, followed by the domain name separated by dots, ending with either a % or a trailing dot. If the domain name does not end with a % or trailing dot, an error is returned. SUPPORTED RR TYPES
MaraDNS only supports the following types of resource records (RRs) in csv1 files. More resource records types are supported in csv2 zone files; see csv2(5) for details. Letter Type RFC1035 section 3.2.2 value A A 1 N NS 2 C CNAME 5 S SOA 6 P PTR 12 @ MX 15 T TXT 16 U any determined in third field of line FORMAT OF SUPPORTED RR TYPES
Here are the formats, shown by letter name: A: Has three fields field one: the domain name field two: the ttl for the name in seconds field three: the ip address, in dotted decimal notation Example: Ahost.example.com.|7200|10.1.2.3 A records are described with grueling detail in RFC1035. In short, an A record is an IP address for a given host name. N: Has three fields field one: the domain name of the record field two: the ttl for the name in seconds field three: the domain name this NS points to. Example: Nexample.com.|86400|ns.example.com. NS (N here) records are described in RFC1035 C: Has three fields field one: the domain name of the record field two: the ttl for the name in seconds field three: the domain this CNAME record points to Example: Calias.example.org.|3200|realname.example.org. CNAME (which C is short for) records are described in RFC1035 S: Has nine fields field one: the domain name of the record field two: the TTL of the record field three: the origin of the domain. In other words, the name of the primary name server for the domain. field four: the email address for this domain (in the RFC822, not BIND format) field five: the serial for the domain field six: the refresh (how often to see updates) for the domain field seven: the retry (how often to try when down) for the domain field eight: the expire (how long before the slave gives up) for the domain field nine: the minimum (and default) TTL for the domain Example: Sexample.net.|86400|%|hostmaster@%|19771108|7200|3600|604800|1800 SOA (S here) records are described in RFC1035 P: has three fields field one: the IP we wish to point to (in in-addr.arpa form) field two: the ttl for the name in seconds field three: the FQDN for the IP in question Example: P3.2.1.10.in-addr.arpa.|86400|ns.example.com. PTR (P here) records, which are used for reverse DNS lookups, are described in RFC1035. Note that one needs control of the appropriate in- addr.arpa subdomain to make PTR records visible on the internet at large. @: has four fields field one: The host that people send email to field two: the ttl for this record field three: The preference for this MX host field four: The name of this MX host Example: @example.com.|86400|10|mail.example.com. MX (@ here) records are described in RFC1035 T: has three fields field one: The host someone wants to get additional information about field two: the ttl for this record field three: The desired text. Any data becomes the record up until a new line is reached. The new line is not part of the TXT record Example: Texample.com.|86400|Example.com: Buy example products online TXT (T here) records are described in RFC1035 U: has four fields field one: The host someone wants a data type normally unsupported by MaraDNS for field two: the ttl for this record field three: The numeric code for this data type (33 for SRV, etc.) field four: The raw binary data for this data type Example: Uexample.com.|3600|40|100102Kitchen sink data The above example is a "Kitchen Sink" RR (see draft-ietf-dnsind-kitchen-sink-02.txt) with a "meaning" of 8, a "coding" of 1, a "subcoding" of 2, and a data string of "Kitchen sink data". Since this particular data type is not formalized in a RFC at this time, the most appropriate method of storing this data is by using the catch-all "unsupported" syntax. EXAMPLE CSV1 ZONE FILE # Example CSV1 zone file # This is what is known as a SOA record. All zone files need to have one # of these S%|86400|%|hostmaster@%|19771108|7200|3600|604800|1800 # These are known as authoritative NS records. All zone files need # one or more of these N%|86400|ns1.% N%|86400|ns2.% # Some IP addresses Ans1.%|86400|10.0.0.1 Ans2.%|86400|192.168.0.1 A%|86400|10.1.2.3 Amx.%|86400|10.1.2.4 # An 'IN MX' record @%|86400|10|mx.% LEGAL DISCLAIMER
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. AUTHOR
Sam Trenholme http://www.samiam.org/ MARADNS
January 2002 CSV1(5)
All times are GMT -4. The time now is 02:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy