x
all questions login
General DNS & Domains Dyn Email Update Clients

PHP CURL and DynDNS API

im using this code to change my ip:

$username = "myuser";
$password = "mypass";

$url      = "https://members.dyndns.org/nic/update?hostname=ts3.dyndns-server.com&myip=82.165.133.254&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);

print $output;

and it just returns badagent, any ideas anyone?

more ▼

asked Oct 06 '10 at 12:35 AM in Default

tehjay gravatar image

tehjay
16 1 1 1

(comments are locked)
10|600 characters needed characters left

4 answers: sort voted first

you can change the user agent with the -A option so curl ... -A 'tolerated browser signature'... Since you have to identify yourself anyway before any browser be accepted at all it takes to stop abuse is lockdown the account after a certain number of warnings I guess.

more ▼

answered Nov 08 '11 at 06:24 PM

nfodor gravatar image

nfodor
16

(comments are locked)
10|600 characters needed characters left

You could also, instead of using curl as an HTTP wrapper, create the HTTP connection yourself on a TCP connection stream and set all the headers yourself, including User-Agent. If you do it properly and follow the guidelines pointed out in the developer documentation Cry Havok linked to, you shouldn't have anything to worry about.

Most likely, DynDNS have blocked certain user agents as a result of previous abuse.

more ▼

answered Oct 06 '10 at 11:16 AM

VikingTiger gravatar image

VikingTiger ♦
11.7k 2 10 128

(comments are locked)
10|600 characters needed characters left

Have you read the documentation? I suspect that your use of curl is the issue and that DynDNS don't accept that as an update agent since it provides no anti-abuse mechanisms (and your code clearly doesn't either).

You may instead want to use an approved update client.

more ▼

answered Oct 06 '10 at 06:06 AM

Cry Havok gravatar image

Cry Havok ♦
80.4k 14 28 283

(comments are locked)
10|600 characters needed characters left

can you post of link of all API? i am not found them. please if can send me by email: clickoncedotvn@gmail.com thanks

more ▼

answered Apr 11 '12 at 05:53 AM

thanhnv0210 gravatar image

thanhnv0210
1 1 2 3

(comments are locked)
10|600 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

© 1998-2013  Dynamic Network Services Inc.  -  Legal Notices  -  Privacy Policy  -  Contacts