2

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?

Flyk
  • 119
  • 1
  • 2
  • 10
romant
  • 526
  • 5
  • 21

3 Answers3

5

found it!

/var/named/1 contains the running config!

romant
  • 526
  • 5
  • 21
  • 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 05: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
2

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.

mrduclaw
  • 429
  • 1
  • 7
  • 16
  • 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 03:10
1

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

Ben Quick
  • 1,215
  • 1
  • 8
  • 8