Figuring out if a Linux executable supports a configuration directive

While debugging a problem last week I needed to quickly see if a version of bind supported the edns-udp-size configuration directive. Since RHEL3, RHEL4 and RHEL5 ship with different releases of Bind, I needed to see when this directive was introduced (EDNS was introduced in Bind 9, and the directive appears to have been there from the start). While I could have read through a crap load of documentation and release notes, I decided an easier approach would be to run nm against all of the binaries and libraries that come with the bind package. Low and behold it was:

$ strings named | egrep 'edns-udp-size.;'

edns-udp-size 4096;

Both the RHEL4 and RHEL5 named binary contained the configuration directive, though RHEL3 did not (RHEL3 ships with Bind 8). The strings tool is a great utility for dumping out ascii strings that are part of the ELF executable, and this simple one-liner (combined with find and xargs) saved me a whole lot of hassle.

This article was posted by Matty on 2011-06-13 22:35:00 -0400 EDT