Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

If, for example, you spend some time working on a named.conf, and then by mistake clear it and save it (thanks to vi), is there a saved copy of the named.conf in the running instance that I could grab?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

found it!

/var/named/1 contains the running config!

share|improve this answer
2  
/var/named/1 is not a standard thing for BIND. Is this perhaps something specific to your OS, packaging system, or other configuration? –  Michael Graff Dec 13 '09 at 5:48
    
you could also grab the SOA info via a Dig or nslookup, which should give a bunch of the info if no all –  Jimsmithkka Oct 14 '10 at 11:20

Since I'm not high-enough to make comments, I'll address my question in my answer, if that's ok.

First, is your instance of vi still running? You can undo, or check if the .swp file exists, it might contain your buffer.

Also, you can definitely dump the processes memory and extract the data you're looking for that way, but this would be significantly more tedious.

share|improve this answer
    
Unfortunately there was a delay in the 'vi' session, so the command was compounded with 'wq!' No more running 'vi', nor a swp file :( –  romant Dec 13 '09 at 3:10

You can use LSOF if your process is still running

IBM example, aimed at AIX but the process should be similar for most implementations. Then an example from Linux.com

Whilst you've already accepted an answer to this question, I'm submitting this response as it may be useful to others that can't rely on the /var/named/1 file existing or if they've removed a file not related to named

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.