Skip to content

This is an Ansible Playbook that uses Hetzner DNS as a DynDNS Service and adds your ISP given IP Address to a DNS name of your choice within your Zone.

Notifications You must be signed in to change notification settings

thedatabaseme/dyndns_hetzner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

DYNDNS_Hetzner

This Playbook updates or creates a DNS Record within your Hetzner DNS managed Zone to a given IP Address. This could be the currently given IP of your Internet Service Provider. If you use a Fritzbox as Internet Modem / Router, you can get your current external IP by using this Playbook here

Requirements

  • Ansible 2.9

You need to have a Hetzner DNS API Key / Token in order to use this Playbook. So your DNS Zone you want to update, must be managed also by Hetzner DNS. For more informations about the Hetzner DNS Service, have a look here.

Playbook Variables

  • dns_zone (Default mydomain.com): Top Level Zone you want to have the DynDNS Record managed / created.
  • dyndns_names (Default -dyndns): A list of names of the DynDNS Records you want to get created. Will be added under the Top Level Domain given as dns_zone.
  • api_key (Default NULL): The API Key / Token you have to create within the Hetzner DNS Dashboard.
  • external_ip_address (Default NULL): The external IP Address you want to use within the DNS Record. May be your current IP given by your ISP.

Dependencies

Be aware, that this Playbook will run at the localhost (Ansible Controlhost) by default.

Example Playbook run Command

An example Playbook Call looks like this. Ofcourse you may want to specify the Variables within your Playbook or within your Inventory:

- ansible-playbook -i hosts -e "api_key=<HETZNER_DNS_API_KEY> dns_zone=myowndomain.com external_ip_address=92.2.1.118" -e '{ "dyndns_names":["cloud","*.cloud"] }' dyndns.yml -k -K -u <USERNAME>

The variable dyndns_names should always be a list type. So even when you want only to set one DNS name to your external_ip_address, you have to specify it as a list like in the example above.

Author Information

This Role is created by P. Haberkern (thedatabaseme)

About

This is an Ansible Playbook that uses Hetzner DNS as a DynDNS Service and adds your ISP given IP Address to a DNS name of your choice within your Zone.

Resources

Stars

Watchers

Forks