[Pdns-users] How to use GeoIP2 database with PowerDNS

Aki Tuomi cmouse at cmouse.fi
Sun May 27 06:28:22 UTC 2018


After digging into this more, it seems that the problem is that 4.1.3 does not support MMDB. That support is going to be added in v4.2.0. It should not crash though, but the fix is going to be more like "your database is not supported" -type of fix, if accepted by maintainers.

Aki

> On May 27, 2018 at 8:19 AM Chris Jones <cpjones44 at gmail.com> wrote:
> 
>     Thanks for documenting Aki. I look forward to this bug being resolved.
> 
>     Regards,
>     Chris.
> 
>     On Sun, May 27, 2018, 4:15 PM Aki Tuomi < cmouse at cmouse.fi mailto:cmouse at cmouse.fi > wrote:
> 
>         > > It seems you found a bug. https://github.com/PowerDNS/pdns/issues/6676
> > 
> >         Aki
> > 
> >         On Sun, May 27, 2018 at 08:43:22AM +1000, Chris Jones wrote:
> >         > Hi Aki,
> >         >
> >         > Here is my geo.yml zone file:
> >         >
> >         > domains:
> >         > - domain:http://geo.example.org
> >         >   ttl: 60
> >         >   records:
> >         >     http://geo.example.org :
> >         >        - soa:http://ns.example.org .http://geoman.example.org . 1 7200 3600 86400 60
> >         >        - ns: http://ns.example.org .
> >         >     http://deu.geo.example.org :
> >         >        - a: 192.0.0.2
> >         >        - txt: Guten Tag
> >         >     http://esp.geo.example.org :
> >         >        - a: 192.0.0.10
> >         >        - txt: Muy buenos dias
> >         >        - loc: 40 8 43.041 N 3 21 42.539 W 714m 10m 100m 10m
> >         >     http://blah.geo.example.org :
> >         >        - a: 1.1.1.1
> >         >     "*.http://geo.example.org ":
> >         >        - a: 127.0.0.53
> >         >        - txt: I don't know exactly where you are
> >         >   services:
> >         >     http://www.geo.example.org : '%http://co.geo.example.org '
> >         >
> >         > Here is the output of some dig commands too (note, the DNS server is on the
> >         > internet, so feel free to dig yourself):
> >         >
> >         > *cpjones at ubuntu:~$* dighttp://blah.geo.example.org @http://14.201.167.71
> >         >
> >         > ; <<>> DiG 9.10.3-P4-Ubuntu <<>>http://blah.geo.example.org @http://14.201.167.71
> >         > ;; global options: +cmd
> >         > ;; Got answer:
> >         > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31532
> >         > ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
> >         > ;; WARNING: recursion requested but not available
> >         >
> >         > ;; OPT PSEUDOSECTION:
> >         > ; EDNS: version: 0, flags:; udp: 1680
> >         > ;; QUESTION SECTION:
> >         > ;http://blah.geo.example.org .          IN      A
> >         >
> >         > ;; ANSWER SECTION:
> >         >http://blah.geo.example.org .   60      IN      A       1.1.1.1
> >         >
> >         > ;; Query time: 3 msec
> >         > ;; SERVER: 14.201.167.71#53(14.201.167.71)
> >         > ;; WHEN: Sun May 27 08:38:54 STD 2018
> >         > ;; MSG SIZE  rcvd: 65
> >         >
> >         > *cpjones at ubuntu:~$* dighttp://geo.example.org @http://14.201.167.71
> >         >
> >         > ; <<>> DiG 9.10.3-P4-Ubuntu <<>>http://geo.example.org @http://14.201.167.71
> >         > ;; global options: +cmd
> >         > ;; Got answer:
> >         > ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25678
> >         > ;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
> >         > ;; WARNING: recursion requested but not available
> >         >
> >         > ;; OPT PSEUDOSECTION:
> >         > ; EDNS: version: 0, flags:; udp: 1680
> >         > ;; QUESTION SECTION:
> >         > ;http://geo.example.org .               IN      A
> >         >
> >         > ;; AUTHORITY SECTION:
> >         >http://geo.example.org .        60      IN      SOA     http://ns.example.org .
> >         >http://geoman.example.org . 1 7200 3600 86400 60
> >         >
> >         > ;; Query time: 4 msec
> >         > ;; SERVER: 14.201.167.71#53(14.201.167.71)
> >         > ;; WHEN: Sun May 27 08:37:37 STD 2018
> >         > ;; MSG SIZE  rcvd: 90
> >         >
> >         > And finally, the record under services:
> >         >
> >         > *cpjones at ubuntu:~$* dighttp://www.geo.example.org @http://14.201.167.71
> >         >
> >         > ; <<>> DiG 9.10.3-P4-Ubuntu <<>>http://www.geo.example.org @http://14.201.167.71
> >         > ;; global options: +cmd
> >         > ;; connection timed out; no servers could be reached
> >         >
> >         > Regards,
> >         > Chris.
> >         >
> >         > On Sun, May 27, 2018 at 3:06 AM Aki Tuomi < cmouse at cmouse.fi mailto:cmouse at cmouse.fi > wrote:
> >         >
> >         > > On Sat, May 26, 2018 at 08:14:15PM +1000, Chris Jones wrote:
> >         > > > Hi there,
> >         > > >
> >         > > > I have successfully setup a pdns instance using the geoip backend and a
> >         > > > copy of the legacy GeoIP database (from
> >         > > > https://dev.maxmind.com/geoip/legacy/install/country/). Throughout the
> >         > > > MaxMind website, I read that this database is end of life in favor for
> >         > > > GeoIP2 (available at https://dev.maxmind.com/geoip/geoip2/geolite2/).
> >         > > >
> >         > > > The GeoIP legacy database is in the .DAT format, and the GeoIP2 database
> >         > > is
> >         > > > in a MMDB format. Reading the pdns documentation, it is confusing whether
> >         > > > MMDB is nativity supported or if I have to do something to the database
> >         > > > file to make it work.
> >         > > >
> >         > >
> >         > > It should work.
> >         > >
> >         > > > My pdns.conf file contains the following parameters when using the GeoIP
> >         > > > legacy database:
> >         > > >
> >         > > > launch=geoip
> >         > > > geoip-database-files=/etc/pdns/GeoIP.dat
> >         > > > geoip-zones-file=/etc/pdns/geo.yml
> >         > > >
> >         > > > That works fine. But when I change the *geoip-database-files* parameter
> >         > > to
> >         > > > use the MMDB file, it does not work (geo requests are timing out -
> >         > > standard
> >         > > > records work fine though).
> >         > > >
> >         > > > launch=geoip
> >         > > > geoip-database-files=/etc/pdns/GeoLite2-City.mmdb
> >         > > > geoip-zones-file=/etc/pdns/geo.yml
> >         > > >
> >         > > > Has anyone got an example or suggestions on how I can use the GeoIP2
> >         > > > databases with the pdns-geoip backend?
> >         > > >
> >         > > > System: CentOS 7 + pdns 4.1.3
> >         > > >
> >         > > > Thanks,
> >         > > > Chris.
> >         > >
> >         > > Can you provide your geo.yml?
> >         > >
> >         > > Aki
> >         > >
> > 
> >     > 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20180527/0d0c94c4/attachment-0001.html>


More information about the Pdns-users mailing list