DnsRecord::queryRecords - Documentation for "last_update" argument?

The last parameter, “last_update” has caught my attention. Can I use this “queryRecords” call to retrieve a list of records that have changed since a specified timestamp?

# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=example.com
1      3       example.com A       mail.example.com    43200   1279918481
2      3       example.com A       example.com    43200   1279918481

The above query works great, but with hundreds of domains on a box, I’d like to query for records updated since the last sync (with a non-InterWorx DNS server).

# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=example.com --last_update 1279918481
# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=example.com --last_update 1279918480
# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=example.com --last_update 1279918482

All three requests return nothing. What am I doing wrong?

You can, though it’s not a timestamp. I’ll have to look at that, I’m surprised it didn’t work.

The real issue is likely that it’s searching for that exact string. Try ‘>1279918481’ instead. You can use >, < (both are actually >= and <=), !, !>, !<, and |, which is absolute value, which…is not useful in this case :slight_smile:

You can also do stuff like ‘last week::now’, ‘>yesterday’, ‘>2010-07-26’, and some other stuff.

It’s basically php’s strtotime function, with some magic bits to make it easier.

Sorry the documentation is lacking :slight_smile:


It appears that strtotime() does not pass through timestamps. I guess I’ve never tried that before, but in this case “>[timestamp]” does not work, so I presume strtotime() is returning something incorrect.

I’m not sure if every strtotime() syntax I have used in the past is working (probably my fault…), however, statements like “>[exact date]” and “>5 minutes ago” are working very well. Thanks for the help!