Re: [Pdns-users] API issue
(resent from correct account - apologies if my previous email also appears eventually) On Sun, 2020-11-22 at 12:24 +0100, Stef Coene via Pdns-users wrote: > Hi, > > I noticed that you can add a record with no content if you specify a > comment. Not exactly - because there is no 'records' array in your request, the existing records (if you have any) are untouched. If you have no test2.test.com/A records, it stays that way. If you had any, they would also stay. > We use the mysql backend. > > This API call works and adds an entry to the comments table: > { >"rrsets": [ > { >"name": "test2.test.com.", >"type": "A", >"ttl": "3600", >"comments": [ > { >"content": "Test command", >"account": "account 1" > } >], >"changetype": "REPLACE" > } >] > } > > I was expecting it would fail because there is no matching entry in the > records table. > > Is this normal behaviour? Yes - comments can exist without records, and records can exist without comments. This makes sure that your comments do not suddenly disappear if your records RRset happens to shrink to zero entries. Kind regards, -- Peter van Dijk PowerDNS.COM BV - https://www.powerdns.com/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com https://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
> we are using PowerDNS version 4.2.2 and seeing errors creating subdomains via > the api. > > The following curl worked for years [1], but after an update to latest pdns > version it is returning 500 http errors: > > curl -i -s -XPATCH \ > -H 'X-API-Key: $powerdns_api_key' \ > https://$powerdns_host/api/v1/servers/localhost/zones/$domain -d '{ > "rrsets": [ >{ > "name": "$subdomain.$domain.", > "type": "A", > "changetype": "REPLACE", > "ttl": 600, > "records": [ >{ > "content": "$ip", > "disabled": false >} > ] >} > ] > }' > > HTTP ISE for "/api/v1/servers/localhost/zones/example.com": Exception: > GSQLBackend unable to insert empty non-terminal rr '_domainkey.example.com' > in domain_id 2: Could not execute mysql statement: insert into records > (type,domain_id,disabled,name,ordername,auth,content,ttl,prio) values > (null,?,0,?,?,?,NULL,NULL,NULL): Column 'type' cannot be null > > Any ideas what´s wrong? To answer my own question: We have a TXT record like 202007._domainkey but had a missing _domainkey record! After adding it the issue is gone - like the error message is saying it... Best regards Stefan ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com https://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Hi Aki, >> we are using PowerDNS version 4.2.2 and seeing errors creating subdomains >> via the api. >> >> The following curl worked for years [1], but after an update to latest pdns >> version it is returning 500 http errors: >> >> curl -i -s -XPATCH \ >> -H 'X-API-Key: $powerdns_api_key' \ >> https://$powerdns_host/api/v1/servers/localhost/zones/$domain -d '{ >> "rrsets": [ >> { >> "name": "$subdomain.$domain.", >> "type": "A", >> "changetype": "REPLACE", >> "ttl": 600, >> "records": [ >> { >> "content": "$ip", >> "disabled": false >> } >> ] >> } >> ] >> }' >> >> HTTP ISE for "/api/v1/servers/localhost/zones/example.com": Exception: >> GSQLBackend unable to insert empty non-terminal rr '_domainkey.example.com' >> in domain_id 2: Could not execute mysql statement: insert into records >> (type,domain_id,disabled,name,ordername,auth,content,ttl,prio) values >> (null,?,0,?,?,?,NULL,NULL,NULL): Column 'type' cannot be null > > Did you remember to update the schema as well? Yes, I executed the documented schema changes. - Stefan ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com https://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Ok, I'm an idiot. Found the problem. I did apt-get the package to install and assumed it was the latest and greatest. The dump/monitor doesn't show version when it has an error. After I deleted all the API lines, the server started. When I dumped the log it showed the version.. PowerDNS version 3.3.1...which has no API support. Eventually, Koko was right ;) I tried the newest version 3.4.3 through instructions ( https://doc.powerdns.com/md/authoritative/installation/) via dpkg install. But when I try to install the pdns-backend-mysql package it won't install, saying it needs pdns 3.3.1. I tried to first install pdns 3.3.1 and get rid off it via dpkg replacing it with pdns 3.4.3. But that doesn't work. Is there a newer version I need to get? 2015-03-05 12:30 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: *Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from'* IIRC (I don't feel like going back to study all this) you've been telling us all the time that all was fine... Before bothering with the API, make sure your PowerDNS server starts without errors. Check the documentation. If you've built this yourself, make sure you build with the necessary options to enable the features you need. Otherwise grab a built package from the PowerDNS downloads page as these include what you're probably missing. When that's done, step by step, go on to the next step. -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
On Thu, Mar 05, 2015 at 05:43:36PM +0100, Melvin Mughal wrote: Ok, I'm an idiot. Found the problem. I did apt-get the package to install and assumed it was the latest and greatest. The dump/monitor doesn't show version when it has an error. After I deleted all the API lines, the server started. When I dumped the log it showed the version.. PowerDNS version 3.3.1...which has no API support. Eventually, Koko was right ;) I tried the newest version 3.4.3 through instructions ( https://doc.powerdns.com/md/authoritative/installation/) via dpkg install. But when I try to install the pdns-backend-mysql package it won't install, saying it needs pdns 3.3.1. I tried to first install pdns 3.3.1 and get rid off it via dpkg replacing it with pdns 3.4.3. But that doesn't work. Is there a newer version I need to get? Hi, the static debian package provided by PowerDNS contains most backends. Aki ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Ok, did a fresh install. Now it's listening on 8081, pdns monitor seems to say everything is oke, but curl still goes bad: /etc/powerdns# service pdns monitor Mar 05 12:36:05 Reading random entropy from '/dev/urandom' Mar 05 12:36:05 This is a standalone pdns Mar 05 12:36:05 UDP server bound to 178.62.251.135:53 Mar 05 12:36:05 TCP server bound to 178.62.251.135:53 Mar 05 12:36:05 PowerDNS Authoritative Server 3.4.3 ( jenk...@autotest.powerdns.com) (C) 2001-2015 PowerDNS.COM BV Mar 05 12:36:05 Using 64-bits mode. Built on 20150302135812 by r...@autotest.powerdns.com, gcc 4.7.2. Mar 05 12:36:05 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2. Mar 05 12:36:05 Polled security status of version 3.4.3 at startup, no known issues reported: OK Mar 05 12:36:05 Creating backend connection for TCP % Mar 05 12:36:05 gmysql Connection successful. Connected to database 'powerdns' on 'localhost'. Mar 05 12:36:05 About to create 3 backend threads for UDP Mar 05 12:36:05 gmysql Connection successful. Connected to database 'powerdns' on 'localhost'. Mar 05 12:36:05 gmysql Connection successful. Connected to database 'powerdns' on 'localhost'. Mar 05 12:36:05 gmysql Connection successful. Connected to database 'powerdns' on 'localhost'. Mar 05 12:36:05 Done launching threads, ready to distribute questions ^C root@8:/etc/powerdns# service pdns start Starting PowerDNS authoritative nameserver: started root@8:/etc/powerdns# service pdns status 686: Child running on pid 688 root@8:/etc/powerdns# lsof -i -P | grep -i 8081 pdns_serv 688 root6u IPv4 35710 0t0 TCP 178.62.251.135:8081 (LISTEN) *Here is the curl (with webserver-allow-from=0.0.0.0):* curl --local-port 8081 -H 'X-API-Key: otto' http://178.62.251.135:8081/servers/localhost/zones curl: (56) Recv failure: Connection reset by peer *Here is the curl with (with webserver-allow-from=my own connection ip, where the curl is coming from)* curl --local-port 8081 -H 'X-API-Key: otto' http://178.62.251.135:8081/servers/localhost/zones Internal Server Error 2015-03-05 17:52 GMT+01:00 Aki Tuomi cmo...@youzen.ext.b2.fi: On Thu, Mar 05, 2015 at 05:43:36PM +0100, Melvin Mughal wrote: Ok, I'm an idiot. Found the problem. I did apt-get the package to install and assumed it was the latest and greatest. The dump/monitor doesn't show version when it has an error. After I deleted all the API lines, the server started. When I dumped the log it showed the version.. PowerDNS version 3.3.1...which has no API support. Eventually, Koko was right ;) I tried the newest version 3.4.3 through instructions ( https://doc.powerdns.com/md/authoritative/installation/) via dpkg install. But when I try to install the pdns-backend-mysql package it won't install, saying it needs pdns 3.3.1. I tried to first install pdns 3.3.1 and get rid off it via dpkg replacing it with pdns 3.4.3. But that doesn't work. Is there a newer version I need to get? Hi, the static debian package provided by PowerDNS contains most backends. Aki ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
I actually just copied/adjusted your config and run the same curl commands. So my config in the pdns.conf for the API: *webserver-address=ip address of the server* *webserver-allow-from=0.0.0.0, ::/0* *webserver-port=8081* *webserver=yes* *experimental-api-key=otto* *experimental-json-interface=yes* The curl commands I run form my own system to the server: *curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost http://xxx.xx.xx.xx:8081/servers/localhost* curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: This version of PowerDNS we use is PowerDNS Authoritative Server 3.4.2. This is the entire pdns.conf file in /etc/powerdns: http://pastebin.com/14LqMbLp Line 623 has crud behind it; that better not be in the configuration. Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
curl --local-port 8081 -H 'X-API-Key: otto' http://178.62.251.135:8081/servers/localhost/zones Why do you insist on using --local-port ? -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Actually, why do you insist on not providing the information that is asked of you. People here are doing their best to help; at the very least it would be polite to respond with the information requested. Christian wrote: Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway This is my last message on this thread. -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
I actually did respond to that Jan-Piet, almost right away with the info he asked for. The problems have finally been solved. The syslog gave a warning one where clause was failing. One field in a table seemed to be wrong and corrected it. Now the curl comes back. Many thanks to all for all the help! 2015-03-05 19:46 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: Actually, why do you insist on not providing the information that is asked of you. People here are doing their best to help; at the very least it would be polite to respond with the information requested. Christian wrote: Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway This is my last message on this thread. -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
As far as I remember this was introduced in 3.4 version of pdns-server On Mar 5, 2015, at 1:20 PM, Keresztes Péter-Zoltán z...@z0z0.tk wrote: What is the version of pdns you are running? On Mar 5, 2015, at 1:11 PM, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: sudo /etc/init.d/pdns monitor Mar 05 06:04:28 Reading random entropy from '/dev/urandom' Mar 05 06:04:28 This is module gmysqlbackend.so reporting Mar 05 06:04:28 This is a standalone pdns Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from' I've tried every example like: webserver-allow-from=127.0.0.0/8,172.16.153.0/24 http://127.0.0.0/8,172.16.153.0/24 webserver-allow-from=0.0.0.0, ::/0 (default according to documentation) Get the same fatal error on every try. 2015-03-05 11:49 GMT+01:00 Keresztes Péter-Zoltán z...@z0z0.tk mailto:z...@z0z0.tk: Try restarting the powerdns or maybe start it in debug mode so that you can see why is not listening. On Mar 5, 2015, at 12:42 PM, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com mailto:christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com mailto:jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com http://www.deduktiva.com/ / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com mailto:Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com mailto:Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Try restarting the powerdns or maybe start it in debug mode so that you can see why is not listening. On Mar 5, 2015, at 12:42 PM, Melvin Mughal mel...@mughal.nu wrote: Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com mailto:christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com mailto:jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com http://www.deduktiva.com/ / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
*sudo /etc/init.d/pdns monitor* *Mar 05 06:04:28 Reading random entropy from '/dev/urandom'* *Mar 05 06:04:28 This is module gmysqlbackend.so reporting* *Mar 05 06:04:28 This is a standalone pdns* *Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from'* I've tried every example like: webserver-allow-from=127.0.0.0/8,172.16.153.0/24 webserver-allow-from=0.0.0.0, ::/0 (default according to documentation) Get the same fatal error on every try. 2015-03-05 11:49 GMT+01:00 Keresztes Péter-Zoltán z...@z0z0.tk: Try restarting the powerdns or maybe start it in debug mode so that you can see why is not listening. On Mar 5, 2015, at 12:42 PM, Melvin Mughal mel...@mughal.nu wrote: Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
On Thu, 5 Mar 2015 12:11:03 +0100 Melvin Mughal mel...@mughal.nu wrote: *Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from'* maybe your pdns is to old, and not support webserver-allow-from setting. ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
What is the version of pdns you are running? On Mar 5, 2015, at 1:11 PM, Melvin Mughal mel...@mughal.nu wrote: sudo /etc/init.d/pdns monitor Mar 05 06:04:28 Reading random entropy from '/dev/urandom' Mar 05 06:04:28 This is module gmysqlbackend.so reporting Mar 05 06:04:28 This is a standalone pdns Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from' I've tried every example like: webserver-allow-from=127.0.0.0/8,172.16.153.0/24 http://127.0.0.0/8,172.16.153.0/24 webserver-allow-from=0.0.0.0, ::/0 (default according to documentation) Get the same fatal error on every try. 2015-03-05 11:49 GMT+01:00 Keresztes Péter-Zoltán z...@z0z0.tk mailto:z...@z0z0.tk: Try restarting the powerdns or maybe start it in debug mode so that you can see why is not listening. On Mar 5, 2015, at 12:42 PM, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com mailto:christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu mailto:mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com mailto:jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com http://www.deduktiva.com/ / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com mailto:Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Running PowerDNS Authoritative Server 3.4.2. 2015-03-05 12:20 GMT+01:00 Keresztes Péter-Zoltán z...@z0z0.tk: What is the version of pdns you are running? On Mar 5, 2015, at 1:11 PM, Melvin Mughal mel...@mughal.nu wrote: *sudo /etc/init.d/pdns monitor* *Mar 05 06:04:28 Reading random entropy from '/dev/urandom'* *Mar 05 06:04:28 This is module gmysqlbackend.so reporting* *Mar 05 06:04:28 This is a standalone pdns* *Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from'* I've tried every example like: webserver-allow-from=127.0.0.0/8,172.16.153.0/24 webserver-allow-from=0.0.0.0, ::/0 (default according to documentation) Get the same fatal error on every try. 2015-03-05 11:49 GMT+01:00 Keresztes Péter-Zoltán z...@z0z0.tk: Try restarting the powerdns or maybe start it in debug mode so that you can see why is not listening. On Mar 5, 2015, at 12:42 PM, Melvin Mughal mel...@mughal.nu wrote: Sorry about being unspecific. This is the uncut version: curl -v 'X-API-Key: otto' http://188.226.135.47:8081/servers/localhost/zones * Rebuilt URL to: X-API-Key: otto/ * Hostname was NOT found in DNS cache * Could not resolve host: X-API-Key * Closing connection 0 curl: (6) Could not resolve host: X-API-Key * Hostname was NOT found in DNS cache * Trying 188.226.135.47... * connect to 188.226.135.47 port 8081 failed: Connection refused * Failed to connect to 188.226.135.47 port 8081: Connection refused * Closing connection 1 curl: (7) Failed to connect to 188.226.135.47 port 8081: Connection refused The main problem is that nothing is listening on 8081, but it's in the config. The firewall (Iptables) is not blocking anything at te moment. So it refuses because nothing is on the port. To be specific: I check the port with the command 'lsof -i -P | grep -i 8081'. 2015-03-05 11:20 GMT+01:00 Christian Hofstaedtler christian.hofstaedt...@deduktiva.com: Hi, On 05 Mar 2015, at 10:57, Melvin Mughal mel...@mughal.nu wrote: The curl commands I run form my own system to the server: curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost curl -s -H 'X-API-Key: otto' http://xxx.xx.xx.xx:8081/servers/localhost/zones And it just returns nothing. So the crud in the API key wasn't an issue I guess. No errors and also no result. But there is a zone file in there, so it should be returning something. I restarted pdns a million times and still no 8081 port listening with this config. You need to stop being unspecific, and you need to stop using “-s” for curl — “nothing” is not a helpful description of an outcome. Start curl with -v and report back both the exact, unmodified curl command line and the complete output curl produced. You do not need to mask your IP addresses, nobody’s going to bother, esp. if those are in an RFC1918 range anyway. 2015-03-05 7:34 GMT+01:00 Jan-Piet Mens jpmens@gmail.com: Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
*Mar 05 06:04:28 Fatal error: Trying to set unexisting parameter 'webserver-allow-from'* IIRC (I don't feel like going back to study all this) you've been telling us all the time that all was fine... Before bothering with the API, make sure your PowerDNS server starts without errors. Check the documentation. If you've built this yourself, make sure you build with the necessary options to enable the features you need. Otherwise grab a built package from the PowerDNS downloads page as these include what you're probably missing. When that's done, step by step, go on to the next step. -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue. 400 Bad Request
Hi, On 05 Mar 2015, at 13:16, kometch kome...@gmail.com wrote: [..] I have used to compile the PowerDNS recursor 3.7.1 on an ARM board from a source that Cubietruck. [..] $ curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/servers/localhost | jq . * Hostname was NOT found in DNS cache * Trying 127.0.0.1... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8082 (#0) GET /servers/localhost HTTP/1.1 User-Agent: curl/7.35.0 Host: 127.0.0.1:8082 Accept: */* X-API-Key: changeme HTTP/1.1 400 Bad Request Content-Type: 11 * no chunk, no close, no size. Assume close to signal end { [data not shown] 100110110 0976 0 --:--:-- --:--:-- --:--:-- 1100 * Closing connection 0 parse error: Invalid numeric literal at line 1, column 4 In some versions, '400 Bad Request’ may also happen because of wrong authentication (i.e. wrong X-API-Key). Please double check the API Key. OTOH, I’m not sure anybody ever tested API on ARM, so maybe you found a bug. Best, Christian -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue. 400 Bad Request
Hello Christian, In some versions, '400 Bad Request’ may also happen because of wrong authentication (i.e. wrong X-API-Key). Please double check the API Key. recursor.conf on which was initialized, and has been set again following parameters, the results did not change. experimental-api-key=changeme experimental-webserver=yes Is this Will such that it should be reported as issue? Best regards. 2015/03/05 21:23、Christian Hofstaedtler christian.hofstaedt...@deduktiva.com のメール: Hi, On 05 Mar 2015, at 13:16, kometch kome...@gmail.com wrote: [..] I have used to compile the PowerDNS recursor 3.7.1 on an ARM board from a source that Cubietruck. [..] $ curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/servers/localhost | jq . * Hostname was NOT found in DNS cache * Trying 127.0.0.1... % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8082 (#0) GET /servers/localhost HTTP/1.1 User-Agent: curl/7.35.0 Host: 127.0.0.1:8082 Accept: */* X-API-Key: changeme HTTP/1.1 400 Bad Request Content-Type: 11 * no chunk, no close, no size. Assume close to signal end { [data not shown] 100110110 0976 0 --:--:-- --:--:-- --:--:-- 1100 * Closing connection 0 parse error: Invalid numeric literal at line 1, column 4 In some versions, '400 Bad Request’ may also happen because of wrong authentication (i.e. wrong X-API-Key). Please double check the API Key. OTOH, I’m not sure anybody ever tested API on ARM, so maybe you found a bug. Best, Christian -- Christian Hofstaedtler / Deduktiva GmbH (FN 418592 b, HG Wien) www.deduktiva.com / +43 1 353 1707 ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Yes because you are telling curl to use port 8081, try just curl hostname:8081 and you commands, i.e. remove --local-port Failing that, try nc localhost 8081 and simulate a HTTP request to the service. AJ On 4 March 2015 at 15:41, Melvin Mughal mel...@mughal.nu wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
You will also have to ensure have been set in config. experimental-json-interface=yes experimental-api-key=changeme On 4 March 2015 at 16:15, Melvin Mughal mel...@mughal.nu wrote: Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Weird... For sure its not hitting the API service, its apache. Could you post version and config information please, removing any identifiable or security information and i will test your config on a vm and let you know AJ On 4 March 2015 at 16:27, Melvin Mughal mel...@mughal.nu wrote: Yes, already in the same config: # Enable and config API experimental-json-interface=yes experimental-api-key=NwYkpVMMuGEaDH8ib (not the real API key) webserver=yes 2015-03-04 17:20 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: You will also have to ensure have been set in config. experimental-json-interface=yes experimental-api-key=changeme On 4 March 2015 at 16:15, Melvin Mughal mel...@mughal.nu wrote: Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Yes, already in the same config: # Enable and config API experimental-json-interface=yes experimental-api-key=NwYkpVMMuGEaDH8ib (not the real API key) webserver=yes 2015-03-04 17:20 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: You will also have to ensure have been set in config. experimental-json-interface=yes experimental-api-key=changeme On 4 March 2015 at 16:15, Melvin Mughal mel...@mughal.nu wrote: Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
This version of PowerDNS we use is PowerDNS Authoritative Server 3.4.2. This is the entire pdns.conf file in /etc/powerdns: http://pastebin.com/14LqMbLp 2015-03-04 18:30 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Weird... For sure its not hitting the API service, its apache. Could you post version and config information please, removing any identifiable or security information and i will test your config on a vm and let you know AJ On 4 March 2015 at 16:27, Melvin Mughal mel...@mughal.nu wrote: Yes, already in the same config: # Enable and config API experimental-json-interface=yes experimental-api-key=NwYkpVMMuGEaDH8ib (not the real API key) webserver=yes 2015-03-04 17:20 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: You will also have to ensure have been set in config. experimental-json-interface=yes experimental-api-key=changeme On 4 March 2015 at 16:15, Melvin Mughal mel...@mughal.nu wrote: Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
Tried the config lines from this post ( http://jpmens.net/2015/01/09/a-look-at-the-powerdns-rest-api/) and the curl commands give no errors anymore. But the problem remains, that nothing is listening on 8081. So the curl in the command line returns nothing. 2015-03-04 20:09 GMT+01:00 Melvin Mughal mel...@mughal.nu: This version of PowerDNS we use is PowerDNS Authoritative Server 3.4.2. This is the entire pdns.conf file in /etc/powerdns: http://pastebin.com/14LqMbLp 2015-03-04 18:30 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Weird... For sure its not hitting the API service, its apache. Could you post version and config information please, removing any identifiable or security information and i will test your config on a vm and let you know AJ On 4 March 2015 at 16:27, Melvin Mughal mel...@mughal.nu wrote: Yes, already in the same config: # Enable and config API experimental-json-interface=yes experimental-api-key=NwYkpVMMuGEaDH8ib (not the real API key) webserver=yes 2015-03-04 17:20 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: You will also have to ensure have been set in config. experimental-json-interface=yes experimental-api-key=changeme On 4 March 2015 at 16:15, Melvin Mughal mel...@mughal.nu wrote: Local port doesn't change anything and nc localhost returns nothing. To configure the port, I added these lines: *# IP Address of web server to listen on* *webserver-address=127.0.0.1* *# Port of web server to listen on* *webserver-port=8081* *# Web server access is only allowed from these subnets* *webserver-allow-from=0.0.0.0/0,::/0 http://0.0.0.0/0,::/0* And restarted pdns with 'sudo service pdns restart'. Now when I run 'sudo lsof -i -P | grep -i 8081' to see what is listening on that port, I get nothing at all listening on that port. Shouldn't the port be listening after the pdns restart? 2015-03-04 16:50 GMT+01:00 Juraj Lutter ju...@lutter.sk: --local-port specifies which OUTGOING PORT will curl use. not the destination port. On 03/04/15 16:41, Melvin Mughal wrote: Yep, tried it. Put it in the config on 8081 and also tried 8082. But then we get the 'curl: (45) bind failed with errno 48: Address already in use' response back. So no luck with that :( 2015-03-04 16:31 GMT+01:00 AJ McKee aj.mc...@druid-dns.com: Hi Melvin, Seems you are talking to your local apache, Try hostname:8081 for your request, unless of course you have gone through the trouble of reverse proxying the pdns instance. AJ On 4 March 2015 at 15:17, Melvin Mughal mel...@mughal.nu wrote: Followed the readme (https://doc.powerdns.com/md/httpapi/README/). Added those three lines to the pdns.conf, to get the API working. When we try an API call, it gives: *!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN* *htmlhead* *title404 Not Found/title* */headbody* *h1Not Found/h1* *pThe requested URL /servers/localhost/zones was not found on this server./p* *hr* *addressApache/2.4.7 (Ubuntu) Server at ourhostname.com http://ourhostname.com Port 80/address* */body/html* When we add the lines to specify on which address the webserver should be found, we get: curl --local-port 8081 -H 'X-API-Key: NwYkpVMMuB8ib' http://ourhostname.com/servers/localhost/zones http://ns3.undev.nl/servers/localhost/zones ruby-2.1.1 [16:05] curl: (45) bind failed with errno 48: Address already in use Anyone knows what's going wrong? ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing listPdns-users@mailman.powerdns.comhttp://mailman.powerdns.com/mailman/listinfo/pdns-users -- Juraj Lutter URL: http://www.wilbury.sk/ XMPP: ju...@lutter.sk Pekny, mily a usmievavy webhosting a serverhousing: http://www.nic.sk/ ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users -- AJ McKee phone: +353 83 1130 545 profile: http://linkedin.com/in/ajmkee jid: aj.mc...@druid-dns.com blog:http://aj.mc-kee.com/ twitter: @ajmckee ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users
Re: [Pdns-users] API issue
This version of PowerDNS we use is PowerDNS Authoritative Server 3.4.2. This is the entire pdns.conf file in /etc/powerdns: http://pastebin.com/14LqMbLp Line 623 has crud behind it; that better not be in the configuration. Also show us the *exact* curl command you're using from the command-line, and the API key (if you're using line 623) better be protected from the shell. :) -JP ___ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users