Labelgate

DNS Labels

Complete reference for Labelgate DNS label properties.

Format

labelgate.dns.<service_name>.<property>=<value>

Properties

PropertyRequiredDefaultDescription
hostnameYes-Full domain name for the DNS record
typeNoARecord type: A, AAAA, CNAME, TXT, MX, SRV, CAA
targetNoautoRecord value. auto = detect public IP, container = container IP
proxiedNotrueEnable Cloudflare proxy (orange cloud)
ttlNoautoTTL in seconds. auto when proxied
credentialNodefaultCredential name to use
cleanupNofalseDelete record when container stops
commentNo-DNS record comment
priorityNo-Priority (required for MX, SRV)
accessNo-Access policy name to apply

Record Types

A / AAAA Records

Point a hostname to an IP address.

labels:
  labelgate.dns.web.hostname: "app.example.com"
  labelgate.dns.web.type: "A"
  labelgate.dns.web.target: "203.0.113.1"
  labelgate.dns.web.proxied: "true"

Special target values:

  • auto - Automatically detect the host's public IP address
  • container - Use the container's internal IP address
  • Any valid IPv4 (A) or IPv6 (AAAA) address

CNAME Records

Create an alias pointing to another hostname.

labels:
  labelgate.dns.www.hostname: "www.example.com"
  labelgate.dns.www.type: "CNAME"
  labelgate.dns.www.target: "example.com"

TXT Records

Add text records (SPF, DKIM, verification, etc.).

labels:
  labelgate.dns.spf.hostname: "example.com"
  labelgate.dns.spf.type: "TXT"
  labelgate.dns.spf.target: "v=spf1 include:_spf.google.com ~all"

MX Records

Configure mail exchange records. Requires priority.

labels:
  labelgate.dns.mail.hostname: "example.com"
  labelgate.dns.mail.type: "MX"
  labelgate.dns.mail.target: "mail.provider.com"
  labelgate.dns.mail.priority: "10"

SRV Records

Service location records. Requires priority, weight, and port.

labels:
  labelgate.dns.xmpp.hostname: "_xmpp._tcp.example.com"
  labelgate.dns.xmpp.type: "SRV"
  labelgate.dns.xmpp.target: "xmpp.example.com"
  labelgate.dns.xmpp.priority: "10"
  labelgate.dns.xmpp.weight: "5"
  labelgate.dns.xmpp.port: "5222"

CAA Records

Certificate Authority Authorization records.

labels:
  labelgate.dns.caa.hostname: "example.com"
  labelgate.dns.caa.type: "CAA"
  labelgate.dns.caa.target: "letsencrypt.org"
  labelgate.dns.caa.flags: "0"
  labelgate.dns.caa.tag: "issue"

Examples

Multiple DNS records from one container

services:
  myapp:
    image: myapp:latest
    labels:
      labelgate.dns.root.hostname: "example.com"
      labelgate.dns.root.type: "A"
      labelgate.dns.root.target: "auto"

      labelgate.dns.www.hostname: "www.example.com"
      labelgate.dns.www.type: "CNAME"
      labelgate.dns.www.target: "example.com"

      labelgate.dns.mail.hostname: "example.com"
      labelgate.dns.mail.type: "MX"
      labelgate.dns.mail.target: "mail.example.com"
      labelgate.dns.mail.priority: "10"

Auto-cleanup for temporary environments

services:
  preview:
    image: preview:latest
    labels:
      labelgate.dns.preview.hostname: "preview.example.com"
      labelgate.dns.preview.target: "auto"
      labelgate.dns.preview.cleanup: "true"

On this page