Документ взят из кэша поисковой машины. Адрес оригинального документа : http://jet.sao.ru/hq/sts/linux/doc/nedit/macro/4/4-13.shtml
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 10:42:10 2012
Кодировка:

Поисковые слова: arp 220
NEdit.org

.
.   
NEdit.org
   .

Home
 - News - Download - Documentation - Search - FTP     
.
.
  

DNS database macros

[Back]

Here's a language mode, a set of higlight patterns and a set of macros, dns.nm, for editing DNS database files.

Some points:

  • Language mode is set to DNS if a SOA record is find in the 200 first characters of the file.
  • In the macro menu, DNS - Increment Serial will increment the serial number of the DNS file.
  • In the macro menu, DNS - SAVE ALL AND ACTIVATE will go to each window open that is in DNS language mode and look if there was any changes. If changes were made to the db file, the serial number is incremented and the file is saved. If any db file was changed, the named daemon is refreshed.
  • This was made on an AIX system. So to refresh the named daemon, the command refresh -s named is used. The result of this command is displayed in a popup.
  • If you use a different system, you need to update the macro function dns_saveAndApply to do a kill -1 of the daemon.
  • You need to edit the files as root to be able to refresh the daemon.
  • In the window background menu you have a macro DNS - Find Reverse IP Address. Click in a line containing an address record, and select this macro. Assuming that all the RR for the reverse mapping are put in one file db.addr, NEdit will open that file and select the line containing the reverse address. If there is no such line, NEdit beeps.
  • In the window background menu you have a macro DNS - Add Reverse IP Address. Click in a line containing an address record, or select a block of lines of address RRs. Selecting this macro will, for each address record:
    • search the db.addr file (same assumptiom that you put all your reverse mapping records in this file) to see if there is already records with same name or same IP address. For each existing record found, a popup will propose you to either delete the old record or ignore it.
    • add the RR for the reverse mapping in the db.addr file. If the name in address record processed was not ending with a dot, the origin to add is taken either from a previous $ORIGIN record or from the /etc/named file primary record pointing to the file edited.
To add in .nedit:
nedit.macroCommands: \
	DNS - Increment Serial@DNS:Shift+Ctrl+I::: {
		dns_incrementSerial()
	}
	DNS - SAVE ALL AND ACTIVATE@DNS:::: {
		dns_saveAndApply()

	}
	}\n
nedit.bgMenuCommands: \
	DNS - Find Reverse IP Address@DNS:::: {
		dns_findReverseIPAddress()
	}
	DNS - Add Reverse Ip Address:::: {
		dns_addReverseAddresseBlock()
	}\n
nedit.highlightPatterns: DNS:1:0{
		Comment:";":"$"::Comment::
		Keyword:"<(IN|NS|MX|CNAME|A|PTR|$ORIGIN|$INCLUDE|HINFO|MB|MG|MINFO|MR|TXT|WKS)>":::Text Arg2::
		IP Address:"[1-2]?[0-9]?[0-9]\\.[1-2]?[0-9]?[0-9]\\.[1-2]?[0-9]?[0-9]\\.[1-2]?[0-9]?[0-9]":::String2::
		Integer:"<[0-9]+>":::String1::
		SOA RR:"^[^ \\t]+[ \\t]+[A-Z]+[ \\t]+SOA[ \\t]+[^ \\t]+[ \\t]+[^ \\t]+[ \\t]+\\(":"^[^;]*\\)"::Text Key::
		SOA Comment:";":"$"::Comment:SOA RR:
	}
nedit.languageModes: 	DNS::"^[^ \\t]+[ \\t]+[A-Z]+[ \\t]+SOA[ \\t]+":::::" "
[Back]

. Released on  Wed, 21 Nov 2001  by C. Denat  

  
Visit our sponsor
Check Metrolink

© NEdit.org
1999-2001
All rights reserved


.