Custom Dns

LogZilla documentation for Custom Dns

Specifying custom DNS servers

Configure Docker’s DNS so all LogZilla containers use the desired resolvers.

  1. Create or edit /etc/docker/daemon.json on the host.

  2. Add DNS settings (JSON):

    json
    {
    "dns": ["1.2.3.4", "5.6.7.8"],
    "dns-search": ["example.com"]
    }
    

    Notes:

    • Replace the IPs and domain with values for the environment.
    • Keep the file valid JSON; merge with existing keys if present.
    • Restarting Docker will interrupt running containers. Plan a short maintenance window.
  3. Restart Docker:

bash
sudo systemctl restart docker

Custom host mappings (without changing DNS)

When DNS reverse lookups are unavailable or specific overrides are needed, configure static host mappings for LogZilla containers using /etc/logzilla/hosts.in (loaded into container /etc/hosts).

  1. Create or edit /etc/logzilla/hosts.in on the host. Format matches /etc/hosts (multiple names per line allowed):

    text
    1.2.3.4 foo.bar.baz
    2.3.4.5 baz.lab.com
    10.11.12.13 somedevice somedevice.foo.com
    
  2. Restart affected container(s) to apply the mapping. For syslog:

    bash
    logzilla restart -c syslog
    
  3. Verify inside the container that the entry exists:

bash
docker exec -ti lz_syslog cat /etc/hosts

The hosts.in file is read by LogZilla during container (re)creation and populates container extra_hosts. Update the file and restart relevant containers whenever mappings change.

Custom Dns | LogZilla Documentation