Dynamic DNS

Hey guys,

I know this probably isn’t a widely desired capability. But, I would like to request the capability to handle dynamic DNS for customers. Something that would support the dyndns calls or at least the functionality would be easily scripted on the client side. Basically, a couple potential customers have asked if I could provide them with the ability to have a DNS entry which is updated via trigger when the customers’ office IP changes. This would have been a no brainer with bind. But, I really am not all that familiar or comfortable with tinydns and how it all works. Besides, I figured it might be a nice value-add capability for most small webhosts these days.

This shouldn’t be very hard. What exactly would you do if it was BIND? (to use as a starting point)

Paul

[QUOTE=IWorx-Paul;16806]This shouldn’t be very hard. What exactly would you do if it was BIND? (to use as a starting point)

Paul[/QUOTE]

Paul,

It’s just a familiarity thing. If it were BIND I would have been able to hack something together as I know BIND’s file formats and how it operates. I just don’t have the knowledge of tinydns.

Paul,

Or, were you looking for ideas on implementation or features? I could give you a rundown of features and such if you’d like.

I’m always up for a rundown.

I was thinking though that you could pretty easily do this with the new top secret (actually, just not yet documented) interworx command line interface to script what you wanted, at least as far as the integration with interworx/tinydns portion goes. Something like


# [b]yum install interworx-cli[/b]
# [b]nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=office.yourdomain.com [/b]
  [I]the first column will be the dns record id you need - scrape that, like, say[/I]
# [b]record_id=`nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=office.yourdomain.com | awk '{print$1}'`[/b]
  [I]Where the new office IP is 123.123.123.123[/I]
# [b]nodeworx -u -n -c DnsRecord -a edit --record_id $record_id --target=123.123.123.123 -v[/b]
  [I]followed by a quick run of the dns cron to make the change instant.[/I]
# [b]~iworx/cron/dns.pex --export --sync --cdb[/b]

Then you just need the “my ip changed” notification to somehow run your script with the new ip, and baddabing.

Paul

  • If you do play around with this, the -h option will be helpful. It’s self documenting, to some degree.

Paul,

I’m just now getting an opportunity to play with this. Does this also update the entry in the database (or however the DNS records are stored for the CP DNS UI) so that the change is reflected in the DNS user interface for either siteworx or nodeworx?

CLI syntax correction

Paul,

Just an FYI, it appears that the nodeworx cli does not actually allow third level (sub.domain.tld) or beyond queries for the --domain field. The query must be performed with only the 2nd level domain (domain.tld) for said field. It then returns a listing of all the associated entries with given 2nd level domain. No worry for me, I just grepped the output to get the desired response line. I just thought I’d let you know in case that is not how the cli is supposed to work.

It would be nice if it would be possible to get an option to query the full hostname.
Thanks again,
Chris.

Does this also update the entry in the database (or however the DNS records are stored for the CP DNS UI) so that the change is reflected in the DNS user interface for either siteworx or nodeworx?

Yes, it’s identical to making the change via the web interface.

Just an FYI, it appears that the nodeworx cli does not actually allow third level (sub.domain.tld) or beyond queries for the --domain field.

I don’t quite follow. The --domain parameter corresponds to the “host” part of the dns record. That might explain why it works the way it does - if it still doesn’t really make sense, maybe provide a specific example?

Paul

Paul, basically the following line is invalid

# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=office.yourdomain.com

This line is valid

# nodeworx -u -n -c DnsRecord -a queryRecords --type=A --domain=yourdomain.com

Not a big deal. But, one that may want to find its way into the documentation. It just required me to grep the actual host line I was looking for then get the hostid.

Chris