Categorygithub.com/nicholas-petersen/coredns-virtualhost
repositorypackage
0.0.0-20240405185222-23ae412273bf
Repository: https://github.com/nicholas-petersen/coredns-virtualhost.git
Documentation: pkg.go.dev

# README

Virtualhost

Name

virtualhost - This plugin allows to resolve docker containers hostnames.

Description

This plugin uses the docker api to inspect docker containers and fetches each container's environment variable VIRTAUL_HOST if the variable exists. The plugin doesn't support port numbers, so a reverse proxy such as nginx-proxy should act as frontend.

Syntax

virtualhost 192.168.0.100

Metrics

If monitoring is enabled (via the prometheus plugin) then the following metrics are exported:

  • coredns_virtualhost_hostname_count{hostname} - Counter of hostname responses

Examples

The IP address(es) must point to the host running Docker.

With IPv4

example.com {
    virtualhost 192.168.0.100
}

With IPv6

example.com {
    virtualhost fe80::8770:87a8:3d30:84da
}

With IPv4 and IPv6

example.com {
    virtualhost 192.168.0.100 fe80::8770:87a8:3d30:84da
}