virtualhost

package module
v0.0.0-...-23ae412 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VirtualHost

type VirtualHost struct {
	Next  plugin.Handler
	A     net.IP
	AAAA  net.IP
	Hosts map[string]struct{}
}

func NewVirtualHost

func NewVirtualHost() *VirtualHost

func (VirtualHost) Name

func (v VirtualHost) Name() string

func (VirtualHost) ServeDNS

func (v VirtualHost) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL