Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: don't have use lua record geoiplookup example #8597

Open
zhubingbing opened this issue Nov 29, 2019 · 13 comments · May be fixed by #14972
Open

doc: don't have use lua record geoiplookup example #8597

zhubingbing opened this issue Nov 29, 2019 · 13 comments · May be fixed by #14972

Comments

@zhubingbing
Copy link

  • Program: Authoritative
  • Issue type: Doc

Short description

I want to try lua record geoiplookup, but I didn't find related documentation,
can u help me how to use this function

Environment

powerdns: 4.2
os: centos 7.6

Steps to reproduce

Expected behaviour

Actual behaviour

Other information

@Habbie
Copy link
Member

Habbie commented Nov 29, 2019

The LUA record geoiplookup function is not documented at all. We should fix that.

@Habbie Habbie added this to the auth-4.3.0 milestone Nov 29, 2019
@Habbie
Copy link
Member

Habbie commented Nov 29, 2019

geoiplookup(ip, attr) where attr is:

  enum GeoIPQueryAttribute {
    ASn, // 0
    City, // 1
    Continent, // 2
    Country, // etc
    Country2,
    Name,
    Region,
    Location
  };

@zhubingbing
Copy link
Author

geoiplookup('1.1.1.1', 'Beijing') to use it ?

@Habbie
Copy link
Member

Habbie commented Nov 29, 2019

geoiplookup('1.1.1.1', 1) to get the City for 1.1.1.1

@zhubingbing
Copy link
Author

got it

@zhubingbing
Copy link
Author

var: bestwho can i use geoiplookup(bestwho, 1)?

@Habbie
Copy link
Member

Habbie commented Nov 29, 2019

geoiplookup(bestwho:toString(), 1) should work, I believe

@zhubingbing
Copy link
Author

zhubingbing commented Nov 29, 2019

how to print this result?A; local city=geoiplookup(bestwho:toString(), 1); print(city)
this right?

@Habbie
Copy link
Member

Habbie commented Nov 29, 2019

sure, that should print to stdout on the process. Alternatively, return it in a TXT record. But this is a support question so we'll take that to IRC.

@zhubingbing
Copy link
Author

it is so sorry;
";local city=geoiplookup(who:toString(),1); print(who,bestwho,city) return '1.1.1.1' "
this is not work, i print is unkown

@zhubingbing
Copy link
Author

i print(who, betwho,city)
this is result 172.253.4.4 114.242.250.0 unknown

@zhubingbing
Copy link
Author

i use this ips https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz,
but it is print unknown

@zhubingbing
Copy link
Author

@Habbie , thank you, now it is work fine;

@Habbie Habbie modified the milestones: auth-4.3.x, auth-4.4.0 Sep 1, 2020
@Habbie Habbie modified the milestones: auth-4.4.0, auth-helpneeded Nov 9, 2020
BozhanL added a commit to BozhanL/pdns that referenced this issue Dec 14, 2024
@BozhanL BozhanL linked a pull request Dec 14, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants