ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Neat trick for routing and Linux

    IT Discussion
    4
    7
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • KellyK
      Kelly
      last edited by

      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
      
      1 Reply Last reply Reply Quote 5
      • dbeatoD
        dbeato
        last edited by

        Pretty cool, does it provide accurate results?

        KellyK 1 Reply Last reply Reply Quote 0
        • KellyK
          Kelly @dbeato
          last edited by

          @dbeato said in Neat trick for routing and Linux:

          Pretty cool, does it provide accurate results?

          So far it has been 100% on.

          1 Reply Last reply Reply Quote 0
          • PenguinWranglerP
            PenguinWrangler
            last edited by

            I have used that trick before, needed to make sure the servers were updating the dynamic DNS correctly.

            1 Reply Last reply Reply Quote 0
            • RamblingBipedR
              RamblingBiped
              last edited by

              I think a curl against ifconfig.me works as well.

              PenguinWranglerP 1 Reply Last reply Reply Quote 1
              • RamblingBipedR
                RamblingBiped
                last edited by RamblingBiped

                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/update

                The API requires HTTPS. Here’s an example request:
                https://username:[email protected]/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4

                Note: 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.

                1 Reply Last reply Reply Quote 0
                • PenguinWranglerP
                  PenguinWrangler @RamblingBiped
                  last edited by

                  @ramblingbiped There are multiple sites you can use to do this.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post