Neat trick for routing and Linux
-
I was troubleshooting some routing issues with some Linux servers and I needed to determine which of two routes they were selecting to eliminate options. Since they don't have a GUI I couldn't just launch a browser and search for "what is my ip". I did some searching, and apparently there is a website that will respond to a curl request.
curl ifconfig.co
-
Pretty cool, does it provide accurate results?
-
@dbeato said in Neat trick for routing and Linux:
Pretty cool, does it provide accurate results?
So far it has been 100% on.
-
I have used that trick before, needed to make sure the servers were updating the dynamic DNS correctly.
-
I think a curl against ifconfig.me works as well.
-
Hmm... This could be a fun project to script your own dynamic DNS service via a cronjob and your Domain Name provider's api. (if that's a thing that is available)
...research starting...
---edit adding initial research results---
Using the API to update your Dynamic DNS record
Dynamic DNS client software automatically updates your dynamic DNS record. You can perform updates manually with the API by making making a POST request (GET is also allowed) to the following url:
https://domains.google.com/nic/updateThe API requires HTTPS. Here’s an example request:
https://username:[email protected]/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4Note: You must set a user agent in your request as well. Web browsers will generally add this for you when testing via the above url. In any case, the final HTTP request sent to our servers should look something like this:
Example HTTP query:
POST /nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4 HTTP/1.1
Host: domains.google.com
Authorization: Basic base64-encoded-auth-string User-Agent: Chrome/41.0 [email protected]Request Parameters:
Parameter Required/Optional Description
username:password Required The generated username and password associated with the host that is to be updated.
hostname Required The hostname to be updated.
myip Optional
(Required if you have an IPv6 address) The IP address to which the host will be set. If not supplied, we’ll use the IP of the agent that sent the request.
Note: Because the address must be an IPv4 address, myip is required if your agent uses an IPv6 address. You can check your agent’s IP address by going to https://domains.google.com/checkip.offline Optional Sets the current host to offline status. If an update request is performed on an offline host, the host is removed from the offline state.
Allowed values are
yes
no
One of the following responses will be returned after the request is processed. -
@ramblingbiped There are multiple sites you can use to do this.