{"id":17663832,"url":"https://github.com/marksmurphy/akamai-staging","last_synced_at":"2025-05-07T08:32:04.743Z","repository":{"id":45348947,"uuid":"176571550","full_name":"markSmurphy/akamai-staging","owner":"markSmurphy","description":"A command line utility to locate an Akamai Staging network IP address for one or more domains","archived":false,"fork":false,"pushed_at":"2024-06-22T03:05:39.000Z","size":447,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T18:02:30.437Z","etag":null,"topics":["akamai","akamai-cli","cdn","cli","dns","domain","fqdn","ip","network","resolve","staging"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/akamai-staging","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markSmurphy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-19T18:07:52.000Z","updated_at":"2023-09-20T08:17:43.000Z","dependencies_parsed_at":"2024-06-22T15:29:27.881Z","dependency_job_id":"cb938e76-074e-4ec0-8c5b-e3f535129156","html_url":"https://github.com/markSmurphy/akamai-staging","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fakamai-staging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fakamai-staging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fakamai-staging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fakamai-staging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markSmurphy","download_url":"https://codeload.github.com/markSmurphy/akamai-staging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252842777,"owners_count":21812739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["akamai","akamai-cli","cdn","cli","dns","domain","fqdn","ip","network","resolve","staging"],"created_at":"2024-10-23T19:42:41.500Z","updated_at":"2025-05-07T08:32:04.714Z","avatar_url":"https://github.com/markSmurphy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# akamai-staging\n\n![Version](https://img.shields.io/npm/v/akamai-staging.svg?style=plastic)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/26159c659fcf42b3be8e17b712ca28bf)](https://www.codacy.com/gh/markSmurphy/akamai-staging/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=markSmurphy/akamai-staging\u0026amp;utm_campaign=Badge_Grade)\n[![DeepScan grade](https://deepscan.io/api/teams/11497/projects/14396/branches/266781/badge/grade.svg)](https://deepscan.io/dashboard#view=project\u0026tid=11497\u0026pid=14396\u0026bid=266781)\n[![Known Vulnerabilities](https://snyk.io/test/npm/akamai-staging/badge.svg)](https://snyk.io/test/npm/akamai-staging)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/akamai-staging.svg?style=plastic)\n![Downloads](https://img.shields.io/npm/dm/akamai-staging.svg?style=plastic)\n![Licence](https://img.shields.io/npm/l/akamai-staging.svg?style=plastic)\n\n## Quick Start\n\n- Install globally using `npm install -g akamai-staging`\n- Run `staging [domain]`\n- Append the output to your local `hosts` file\n\n## Overview\n\n**A command line utility to locate an Akamai Staging network IP address for one or more domains.**\n\nIf you work on a website hosted behind Akamai's CDN you will, on occasion, need to test a newer Akamai configuration for your domain via their **Staging** network.  This utility provides you with a staging network IP address for the supplied domain in a `hosts` file format.\n\n---\n\n## Description\n\nUnder normal operations, when you browse a domain fronted by Akamai's CDN, the internet's DNS will resolve the domain to the IP address of your nearest Akamai point-of-presence on their **Production** network.\n\nWhen it is necessary to test a newer Akamai configuration for a domain, you need to override DNS via a local `hosts` file entry which resolves the domain to an IP address in Akamai's **Staging** network.\n\nThis utility aids that process by accepting one or more fully qualified domain names and listing out their respective **Staging** IP addresses.\n\n---\n\n## Installation\n\n`npm install -g akamai-staging`\n\n---\n\n## Usage\n\n`staging domain [domain [domain] ...]`\n\n---\n\n## Examples\n\n### A single domain\n\n`staging www.akamai.com`\n\n```bash\nC:\\\u003e staging www.akamai.com\n\n104.82.168.181 www.akamai.com                         #Akamai Staging variant of [www.akamai.com.edgekey.net]\n\n```\n\n![A single domain](https://marksmurphy.github.io/img/akamai-staging.single-domain.gif)\n\n### Multiple domains\n\nIf your front-end consists of multiple domains, you may need to point more than one to the **Staging** network.  You can pass multiple domains, separated by `spaces`, via the command line:\n\n`staging www.asos.com api.asos.com my.asos.com`\n\n```bash\nC:\\\u003e staging www.asos.com api.asos.com my.asos.com\n\n23.50.57.68 www.asos.com                             #Akamai Staging variant of [snir.www.asos.com.v4.edgekey.net]\n23.50.57.240 api.asos.com                            #Akamai Staging variant of [snir.asos.com.v4.edgekey.net]\n23.50.57.68 my.asos.com                              #Akamai Staging variant of [snir.www.asos.com.v4.edgekey.net]\n\n```\n\n![Multiple domains](https://marksmurphy.github.io/img/akamai-staging.multiple-domains.gif)\n\n### Redirecting output to `hosts` file\n\nWhy not redirect `stdout` to append the `hosts` file, seeing as you're going to need these entries in there anyway.\n\n*NB* **you may have flush your O/S's resolver cache, and flush your browser DNS cache before new `hosts` entry is recognised**\n\n#### Windows (as local admin)\n\n⚠ Make sure you use a double greater-than redirect `\u003e\u003e` to *append* to the target file; using only one will replace the target file and nuke your current `hosts` file.\n\n`C:\\\u003e staging www.akamai.com \u003e\u003e %systemroot%\\system32\\drivers\\etc\\hosts`\n\n`C:\\\u003e type %systemroot%\\system32\\drivers\\etc\\hosts`\n\n```text\n# Copyright (c) 1993-2009 Microsoft Corp.\n#\n# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.\n#\n# This file contains the mappings of IP addresses to host names. Each\n# entry should be kept on an individual line. The IP address should\n# be placed in the first column followed by the corresponding host name.\n# The IP address and the host name should be separated by at least one\n# space.\n#\n# Additionally, comments (such as these) may be inserted on individual\n# lines or following the machine name denoted by a '#' symbol.\n#\n# For example:\n#\n#      102.54.94.97     rhino.acme.com          # source server\n#       38.25.63.10     x.acme.com              # x client host\n\n# localhost name resolution is handled within DNS itself.\n#       127.0.0.1       localhost\n#       ::1             localhost\n\n\n\n23.195.136.39 www.akamai.com                         #Akamai Staging variant of [www.akamai.com.edgekey.net]\n\n\n```\n\n#### Linux (as root)\n\n#### Error reporting and redirection / piping\n\nAll hosts file entries and staging IP addresses are output to `stdout` while all errors are output to `stderr`.\nThis means that if you use the redirection approach [above](#redirecting-output-to-hosts-file), successful staging IP lookups will be written to the target file while errors appear in the console.\n\n![Redirect to a file](https://marksmurphy.github.io/img/akamai-staging.redirect-to-file.gif)\n\nYou can redirect them individually by using the notation `1\u003e` to direct `stdout` and `2\u003e` to redirect `stderr` somewhere else.\n\n*Note*: All errors are printed with a preceding hash character `#`, which denotes a *comment* in the `hosts` file. So, if you wish, you could redirect both `stdout` and `stderr` to the target file without it compromising the `hosts` file structure.\n\n`$ sudo staging www.akamai.com \u003e\u003e /etc/hosts`\n\n`$ cat /etc/hosts`\n\n```bash\n127.0.0.1    localhost\n\n# The following lines are desirable for IPv6 capable hosts\n::1     ip6-localhost ip6-loopback\nfe00::0 ip6-localnet\nff00::0 ip6-mcastprefix\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters\n\n23.195.136.39 www.akamai.com                         #Akamai Staging variant of [www.akamai.com.edgekey.net]\n\n```\n\n---\n\n## Debugging\n\n`akamai-staging` uses the npm package [debug](https://www.npmjs.com/package/debug \"www.npmjs.com\").  If you set the environment variable `debug` to `staging` you'll see full debug output.\n\n### Windows\n\n```bash\nset debug=staging\nstaging [domain]\n```\n\n### Linux\n\n```bash\nDEBUG=staging staging [domain]\n```\n\n### Powershell\n\n```bash\n$env:debug=\"staging\"\nnode akamai-staging [domain]\n```\n\n---\n\n## Restrictions\n\n### Apex domains are not currently supported\n\nDNS standards do not allow a `CNAME` record in the apex (`A` or `AAAA` are the only allowed record types), and DNS providers get around this in proprietary ways.  The use of `dns.resolveCname` to get the initial alias of the hostname fails because it's not a `CNAME` record that's being returned.\n\n---\n\n## Change Log\n\nThe `CHANGELOG.md` can be found [here](./CHANGELOG.md)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fakamai-staging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarksmurphy%2Fakamai-staging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fakamai-staging/lists"}