DNS
The domain used is defined in the variable hms_docker_domain in inventory/group_vars/all/main.yml
UniFi DNS Role
Section titled “UniFi DNS Role”There is an Ansible role available to enable that will manage the required DNS records if you are using a UniFi Network controller.
The role should only modify records that are used in this playbook and will create CNAME records that point to a single A record. This UniFi DNS role was created by Claude Code, so use at your own risk.
To enable, create the A record that points to your host manually in the Unifi console and then in your inventory/group_vars/all/unifi.yml file configure the following:
---# Enable or disable the Unifi DNS roleunifi_dns_enabled: false
# The Unifi controller base URL (do NOT include a trailing slash)# Example: "https://192.168.1.1"unifi_dns_controller_url: ""
# The Unifi API key for authentication# Generated in the Integrations section of your UniFi applicationunifi_dns_api_key: ""
# The Unifi site name to manage DNS records for# This matches the "internalReference" field from the sites APIunifi_dns_site_name: "default"
# The target A record domain name that all CNAME records will point to# Example: "server.home.local"unifi_dns_cname_target: ""
# Whether to include external Traefik hosts in DNS record managementunifi_dns_include_external_hosts: true
# Whether to include 4K instance subdomains (sonarr-4k, radarr-4k)unifi_dns_include_4k_instances: trueAccessing the Containers
Section titled “Accessing the Containers”Internally
Section titled “Internally”There are several approaches for setting up internal DNS records. Choose whichever best fits your environment:
-
Wildcard
Arecord (simplest) — Create a*.<domain>record on your local DNS server pointing to the private IP address of the server. This covers all subdomains automatically. -
Individual
Arecords — Create a separateArecord for each container listed in the Container Map. -
Single
Arecord +CNAMErecords (recommended) — Create oneArecord (e.g.,server.<domain>) and thenCNAMErecords for each container pointing to it. This way, if the server IP changes, you only need to update one record.
To verify DNS is working, run:
nslookup <container>.<domain># Or query a specific DNS server:nslookup <container>.<domain> <DNS server IP>Once DNS resolves correctly, access containers at <name>.<domain> where <name> is the proxy_host_rule value from the container map and <domain> is the value of hms_docker_domain.
You can customize the subdomain for each application by changing its proxy_host_rule value in the container map.
Externally
Section titled “Externally”For external access, if you enabled Cloudflare DDNS, a request.<domain> public A record will be created automatically that points to your network’s public IP.
- This default
Arecord can be changed in thecloudflare_ddns_subdomainvariable located ininventory/group_vars/all/cloudflare.yml.
Unless port 80 and/or 443 are port forwarded on the router to your host, accessing this public address from outside your main network will not work.
To grant public access to containers, you will need to:
-
Preferred Use a Cloudflare Tunnel
-
OR Create a public DNS record for it that is either:
-
Arecord that points to the public IP -
CNAMErecord that points to the<cloudflare_ddns_subdomain>.<domain>(eg.seerr.example.com)
-
-
Set the
expose_to_publicvalue toyesfor the specific container in the Container Map