Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Considering the complete lack of luck I've had googling any terms related to this question, this may not even be possible, but:

Is there a reasonably standard way to set a hostname on a machine, and have that hostname "pushed" to a BIND-based DNS server instead of the other way around?


DHCP is banned in this particular environment, so I need to come up with an alternate way to deploy systems quickly. I'm close to just hacking together something with Puppet and a web UI to automate populating hostnames, but a push from the client would be easier to automate (since then all I'd have to touch is one dialog in the installer).

All of the client systems in question are Linux based.

share|improve this question
what OS are your client systems running? – Rex Dec 18 '13 at 22:56
@Rex all various flavors of Linux, mostly Ubuntu – Mikey T.K. Dec 18 '13 at 22:57
up vote 1 down vote accepted

I don't know if there a set standard way, but assuming the BIND server is configured to allow dynamic updates, you could run a shell script on startup (or on a cron job) to run nsupdate to update the record.


ECHO server <mydnsserver> > /tmp/dnsupdate

ECHO "zone <mydomain>" >> /tmp/dnsupdate
ECHO "update delete A" >> /tmp/dnsupdate
ECHO "update add 60 A myipaddress" >> /tmp/dnsupdate
ECHO "send" >> /tmp/dnsupdate

ECHO "zone <>" >> /tmp/dnsupdate
ECHO "update delete <> PTR <>" >> /tmp/dnsupdate
ECHO "update add < 60 PTR <>" >> /tmp/dnsupdate
ECHO "send" >> /tmp/dnsupdate

nsupdate -v /tmp/dnsupdate

If you need secured updates, you can create a keypair and specify the key nsupdate -k <keyfile> -v /tmp/dnsupdate. You could also make the script more generic and usable by pulling the hostname and IP info as part of the script into variables.

share|improve this answer
You should also update the PTR record if possible. – Fred the Magic Wonder Dog Dec 18 '13 at 23:18
@FredtheMagicWonderDog updated -it should work but might still need some modification. – Rex Dec 18 '13 at 23:27
This is awesome - never heard of this tool before, but it works perfectly for my needs! Thanks! – Mikey T.K. Dec 18 '13 at 23:40
Actually, the ptr portion isn't great as it would not account for an IP address change. You would need to query for the old/original ip before making any updates and delete the old ptr record. – Rex Dec 18 '13 at 23:59

Your Answer


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.