auto make -f Makefile.doc
Signed-off-by: coredns[bot] <bot@bot.coredns.io>
This commit is contained in:
parent
e0110264cc
commit
81722196b3
2 changed files with 202 additions and 0 deletions
118
man/coredns-geoip.7
Normal file
118
man/coredns-geoip.7
Normal file
|
@ -0,0 +1,118 @@
|
|||
.\" Generated by Mmark Markdown Processer - mmark.miek.nl
|
||||
.TH "COREDNS-GEOIP" 7 "July 2021" "CoreDNS" "CoreDNS Plugins"
|
||||
|
||||
.SH "NAME"
|
||||
.PP
|
||||
\fIgeoip\fP - Lookup maxmind geoip2 databases using the client IP, then add associated geoip data to the context request.
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The \fIgeoip\fP plugin add geo location data associated with the client IP, it allows you to configure a geoIP2 maxmind database
|
||||
\[la]https://dev.maxmind.com/geoip/docs/databases\[ra] to add the geo location data associated with the IP address.
|
||||
|
||||
.PP
|
||||
The data is added leveraging the \fImetadata\fP plugin, values can then be retrieved using it as well, for example:
|
||||
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
import (
|
||||
"strconv"
|
||||
"github.com/coredns/coredns/plugin/metadata"
|
||||
)
|
||||
// ...
|
||||
if getLongitude := metadata.ValueFunc(ctx, "geoip/longitude"); getLongitude != nil {
|
||||
if longitude, err := strconv.ParseFloat(getLongitude(), 64); err == nil {
|
||||
// Do something useful with longitude.
|
||||
}
|
||||
} else {
|
||||
// The metadata label geoip/longitude for some reason, was not set.
|
||||
}
|
||||
// ...
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.SH "DATABASES"
|
||||
.PP
|
||||
The supported databases use city schema such as \fB\fCCity\fR and \fB\fCEnterprise\fR. Other databases types with different schemas are not supported yet.
|
||||
|
||||
.PP
|
||||
You can download a free and public City database
|
||||
\[la]https://dev.maxmind.com/geoip/geolite2-free-geolocation-data\[ra].
|
||||
|
||||
.SH "SYNTAX"
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
geoip [DBFILE]
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.IP \(bu 4
|
||||
\fBDBFILE\fP the mmdb database file path.
|
||||
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
The following configuration configures the \fB\fCCity\fR database.
|
||||
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
\&. {
|
||||
geoip /opt/geoip2/db/GeoLite2\-City.mmdb
|
||||
metadata # Note that metadata plugin must be enabled as well.
|
||||
}
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.SH "METADATADA LABELS"
|
||||
.PP
|
||||
A limited set of fields will be exported as labels, all values are stored using strings \fBregardless of their underlying value type\fP, and therefore you may have to convert it back to its original type, note that numeric values are always represented in base 10.
|
||||
|
||||
.RS
|
||||
.TS
|
||||
allbox;
|
||||
l l l l
|
||||
l l l l .
|
||||
\fBLabel\fP\fB Type\fP\fB Example\fP\fB Description\fP
|
||||
\fB\fCgeoip/city/name\fR \fB\fCstring\fR \fB\fCCambridge\fR Then city name in English language.
|
||||
\fB\fCgeoip/country/code\fR \fB\fCstring\fR \fB\fCGB\fR Country ISO 3166-1
|
||||
\[la]https://en.wikipedia.org/wiki/ISO_3166-1\[ra] code.
|
||||
\fB\fCgeoip/country/name\fR \fB\fCstring\fR \fB\fCUnited Kingdom\fR The country name in English language.
|
||||
\fB\fCgeoip/country/is_in_european_union\fR \fB\fCbool\fR \fB\fCfalse\fR Either \fB\fCtrue\fR or \fB\fCfalse\fR.
|
||||
\fB\fCgeoip/continent/code\fR \fB\fCstring\fR \fB\fCEU\fR See Continent codes
|
||||
\[la]#ContinentCodes\[ra].
|
||||
\fB\fCgeoip/continent/name\fR \fB\fCstring\fR \fB\fCEurope\fR The continent name in English language.
|
||||
\fB\fCgeoip/latitude\fR \fB\fCfloat64\fR \fB\fC52.2242\fR Base 10, max available precision.
|
||||
\fB\fCgeoip/longitude\fR \fB\fCfloat64\fR \fB\fC0.1315\fR Base 10, max available precision.
|
||||
\fB\fCgeoip/timezone\fR \fB\fCstring\fR \fB\fCEurope/London\fR The timezone.
|
||||
\fB\fCgeoip/postalcode\fR \fB\fCstring\fR \fB\fCCB4\fR The postal code.
|
||||
.TE
|
||||
.RE
|
||||
|
||||
|
||||
.SH "CONTINENT CODES"
|
||||
.RS
|
||||
.TS
|
||||
allbox;
|
||||
l l
|
||||
l l .
|
||||
\fBValue\fP\fB Continent (EN)\fP
|
||||
AF Africa
|
||||
AN Antarctica
|
||||
AS Asia
|
||||
EU Europe
|
||||
NA North America
|
||||
OC Oceania
|
||||
SA South America
|
||||
.TE
|
||||
.RE
|
||||
|
||||
|
84
man/coredns-header.7
Normal file
84
man/coredns-header.7
Normal file
|
@ -0,0 +1,84 @@
|
|||
.\" Generated by Mmark Markdown Processer - mmark.miek.nl
|
||||
.TH "COREDNS-HEADER" 7 "July 2021" "CoreDNS" "CoreDNS Plugins"
|
||||
|
||||
.SH "NAME"
|
||||
.PP
|
||||
\fIheader\fP - modifies the header for responses.
|
||||
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fIheader\fP ensures that the flags are in the desired state for responses. The modifications are made transparently for
|
||||
the client.
|
||||
|
||||
.SH "SYNTAX"
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
header {
|
||||
ACTION FLAGS...
|
||||
ACTION FLAGS...
|
||||
}
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.IP \(bu 4
|
||||
\fBACTION\fP defines the state for DNS message header flags. Actions are evaluated in the order they are defined so last one has the
|
||||
most precedence. Allowed values are:
|
||||
|
||||
.RS
|
||||
.IP \(en 4
|
||||
\fB\fCset\fR
|
||||
.IP \(en 4
|
||||
\fB\fCclear\fR
|
||||
|
||||
.RE
|
||||
.IP \(bu 4
|
||||
\fBFLAGS\fP are the DNS header flags that will be modified. Current supported flags include:
|
||||
|
||||
.RS
|
||||
.IP \(en 4
|
||||
\fB\fCaa\fR - Authoritative(Answer)
|
||||
.IP \(en 4
|
||||
\fB\fCra\fR - RecursionAvailable
|
||||
.IP \(en 4
|
||||
\fB\fCrd\fR - RecursionDesired
|
||||
|
||||
.RE
|
||||
|
||||
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
Make sure recursive available \fB\fCra\fR flag is set in all the responses:
|
||||
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
\&. {
|
||||
header {
|
||||
set ra
|
||||
}
|
||||
}
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.PP
|
||||
Make sure "recursion available" \fB\fCra\fR and "authoritative answer" \fB\fCaa\fR flags are set and "recursion desired" is cleared in all responses:
|
||||
|
||||
.PP
|
||||
.RS
|
||||
|
||||
.nf
|
||||
\&. {
|
||||
header {
|
||||
set ra aa
|
||||
clear rd
|
||||
}
|
||||
}
|
||||
|
||||
.fi
|
||||
.RE
|
||||
|
Loading…
Add table
Reference in a new issue