0

This page has documentation on pygodaddy, which is a python script to update the IPv4 address in Go Daddy's DNS. I installed this package on my CentOS machine using pip install pygodaddy. The documentation provides this example:

from pygodaddy import GoDaddyClient
client = GoDaddyClient()
if client.login(username, password):
    print client.find_domains()
    client.update_dns_record('sub.example.com', '1.2.3.4')

On my CentOS machine, I've created a file named godaddy.py, with the following. Note: The username and password provided are just for demonstation, and not my real username and password.

#!/usr/bin/env python
import pygodaddy
import logging

from pygodaddy import GoDaddyClient
client = GoDaddyClient()
logging.basicConfig(filename=/var/log/godaddy/godaddy.log, format='%(asctime)S %(message)s', level=logging.DEBUG)
if client.login('36524174', 'Bht45f!as34Ra'):
    print client.find_domains()
    client.update_dns_record('wima2.freekb.net', '12.34.56.78')

When typing python godaddy.py in the Terminal, nothing happens for a while, and then eventually this is displayed:

File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
  raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='dns.godaddy.com', port=443): Max retries exceeded with url: /default.aspx (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x176e350>: Failed to establish a new connection: [Errno 110] Connection timed out',))

I've disabled iptables. I've set the permissions of my script to 777, owned by root:root.

This post recommends adding sleep(int). I added sleep(1), yet I still get connection timed out.

#!/usr/bin/env python
import pygodaddy
import logging
import sleep

from pygodaddy import GoDaddyClient
client = GoDaddyClient()
logging.basicConfig(filename=/var/log/godaddy/godaddy.log, format='%(asctime)S %(message)s', level=logging.DEBUG)
if client.login('36524174', 'Bht45f!as34Ra'):
    time.sleep(1)
    print client.find_domains()
    client.update_dns_record('wima2.freekb.net', '12.34.56.78')

Being relatively new to Python, I am not certain how to debug this connection issue.

EDIT: While I do have a proxy server in my LAN, I've configured my machines to not route traffic through my proxy server. On any machine in my LAN, Linux or Windows, I can ping dns.godaddy.com, and I get a response, with no packet loss, so I know I have the ability to talk to dns.godaddy.com. The python script uses port 443. If I attempt to telnet dns.godaddy.com 443, the connection times out.

telnet dns.godaddy.com 443
Trying 104.238.65.158. . .
telnet: Unable to connect to remote host: Connection timed out    

I also tried using nmap to see the hops between my client and dns.godaddy.com. Much to my surprise, when tracing the route to dns.godaddy.com on port 443, the packets are able to hop all the way to dns.godaddy.com. I wonder why I get connection timed out with telnet and the python script, but nmap is able to "connect".

nmap -Pn --traceroute -p 443 dns.godaddy.com

Starting Nmap 6.40 ( http://nmap.org ) at 2017-01-02 19:17 CST
Nmap scan report for dns.godaddy.com (104.238.65.158)
Host is up (0.076s latency).
rDNS record for 104.238.65.158: ip-104-238-65-158.ip.secureserver.net
PORT     STATE      SERVICE
443/tcp  filtered   https

TRACEROUTE (using proto 1/icmp)
HOP RTT       ADDRESS
1    4.67 ms  r1.software.eng.us (192.168.0.1)
2   18.84 ms  142.254.152.173
3   35.83 ms  ae62.applwibp02h.midwest.rr.com (24.164.240.217)
4   28.85 ms  be22.gnfdwibb01r.midwest.rr.com (65.31.113.6)
5   30.93 ms  bu-ether16.chcgildt87w-bcr00.tbone.rr.com (66.109.6.204)
6   33.18 ms  bu-ether11.chctilwc00w-bcr00.tbone.rr.com (66.109.6.21)
7   77.75 ms  4.28.83.74
8   69.48 ms  ip-184-168-0-117.ip.secureserver.net (184.168.0.117)
9   83.20 ms  ip-104-238-65-158.ip.secureserver.net (104.238.65.158)
Community
  • 1
  • 1
JeremyCanfield
  • 633
  • 11
  • 24
  • Outside of well, TCP connection timeout you'd really want to remove your clientID and password from first and last sample code snippet. And in general just change it, if it's the real one. – favoretti Jan 02 '17 at 14:38
  • 1
    If you type `telnet dns.godaddy.com 443` from your terminal, do you get a connection? – favoretti Jan 02 '17 at 14:39
  • Interesting. telnet dns.godaddy.com 443 also produces Connection timed out on both Linux and Windows machines in my LAN, and when navigating to http://dns.godaddy.com or https://dns.godaddy.com in a browser, "site cannot be reached" is displayed. It seems that dnsodaddy.com does not listen on 80 or 443. I'll contact Go Daddy support to confirm. – JeremyCanfield Jan 02 '17 at 15:05
  • 1
    It does listen. What might be the case though, it that your network requires proxy to be set for those requests. – favoretti Jan 02 '17 at 15:07
  • You are probably right that this has something to do with proxy. I do have a proxy in my LAN. My windows machine is using the proxy, and my Linux machine is not using the proxy. Let me see if I can figure out if the proxy in my LAN is the issue. – JeremyCanfield Jan 02 '17 at 15:16
  • 1
    Before you run that script, just do `export https_proxy="http://your.proxy.address:3128"` or so. – favoretti Jan 02 '17 at 15:24
  • Thanks for the recommendation. I configured my machines to not route through my proxy server, to eliminate my proxy as the issue. I've added edits to my post. – JeremyCanfield Jan 03 '17 at 01:33

1 Answers1

0

It looks like the pygodaddy script is no longer working properly, as observed here: https://github.com/observerss/pygodaddy/issues/22. Others have used the godaddypy script instead.

JeremyCanfield
  • 633
  • 11
  • 24