Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have couple of linux servers that I to assign static IPs to because I'm doing some CARPing and Vlans.

The way my DNS server is set, it gets the hostnames dynamically from the nodes, as soon as there is a new node on the network.

This approach only works unfortunately for servers with dhcp clients. To send hostname, you edit /etc/dhcp3/dhclient.conf file with hostnames, and restart dhclient.

Anyone knows of a way to do this with servers with static ip's?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Yes, you can use nsupdate in your /etc/network/if-up.d/ directory.

For example

echo -e "server ns1.domain\n zone domain\n update delete test.domain\n update add test.domain 600 A 10.1.1.188\n send" | nsupdate

In long form, this is:

nsupdate
> server ns1.domain
> zone domain
> update delete test.domain
> update add test.domain 600 A 10.1.1.188
> send

So this saying

  1. Choose the ns1.domain name server
  2. update the "domain" zone
  3. Delete the current record
  4. Add the new record
  5. Send to name server

On the name server, you will need to allow updates, which in bind is the directive:

allow-update { 10.10.10.0/24; };

This would allow updates from the 10.10.10.0/24 network

share|improve this answer
    
do you need some type of credentials to the dns server for this type of update –  kmassada Feb 18 '13 at 19:52
    
@kmassada It is optional - the above example doesn't require auth, but you can use pre-shared keys to authenticate clients. In your case, you are already allowing updates from the dhcp server, so you can choose to extend this to the statics, or use keys. –  Paul Feb 18 '13 at 21:05
add comment

Your Answer

 
discard

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.