diff --git a/src/systemd_resolved_docker/dockerwatcher.py b/src/systemd_resolved_docker/dockerwatcher.py index ae9937fa0cafe26843db8fc75e07f484867e37f2..aae6d15cb61d688738aa4c0b6685766b8a5a2277 100644 --- a/src/systemd_resolved_docker/dockerwatcher.py +++ b/src/systemd_resolved_docker/dockerwatcher.py @@ -51,7 +51,7 @@ class DockerWatcher(Thread): # if no explicit --hostname is provided, than it will be the first 12 characters of the container_id. # In that case, the hostname can be ignored - if hostname not in container_id: + if hostname != container_id[:12]: if len(domain) > 0: common_hostnames.append('%s.%s' % (hostname, domain)) else: