ChangeMyIP on Linux: Change Your IP and Verify It (Beginner Setup)
A beginner-friendly, terminal-first walkthrough for routing Linux traffic through ChangeMyIP HTTP and SOCKS5 endpoints, then proving the IP actually changed with curl checks and a leak sanity test.
Overview
A proxy changes the IP address that a destination site sees, because the site answers the proxy rather than your machine. On Linux you can point individual commands at a ChangeMyIP endpoint, or set environment variables that most command-line tools read automatically. This tutorial covers both approaches at a beginner level and ends with a verification step so you know the change actually happened.
ChangeMyIP provides shared and dedicated datacenter proxies plus residential proxies with rotating IPs, reachable over HTTP and SOCKS5 as well as Shadowsocks, Trojan, DNS, and WireGuard. This guide uses HTTP and SOCKS5 only, in keeping with a first setup.
Before You Start
- An active ChangeMyIP subscription. Your dashboard or plan details list the proxy host, port, and username/password you will use.
- A Linux machine (desktop or server) with
curl. Confirm it withcurl --version. - A terminal session. Open one new shell for testing so you can close it and discard everything.
- Optional: a text editor for shell profile files such as
~/.bashrcor~/.zshrc.
Pick the Right Endpoint for the Job
| Endpoint type | How the IP behaves | Typical first use |
|---|---|---|
| Shared datacenter | One of many IPs in a shared pool; other users may see the same IP | Testing that your setup works, general browsing |
| Dedicated datacenter | An IP assigned to your account | Keeping one stable identity for accounts you own |
| Residential | Rotating IPs drawn from real ISP ranges | Checking geo-targeted pages, moderate-scale data collection |
Your plan details decide which country or city codes you can request. ChangeMyIP's pool covers 40+ countries and 300+ cities; use the country and city parameters exactly as documented for your plan rather than guessing them.
Steps
Step 1: Load your credentials into the shell
read -r -p "Proxy host and port (host:port): " CM_HOST
read -r -p "Proxy username: " CM_USER
read -r -s -p "Proxy password: " CM_PASS; echo
read -s keeps the password off the screen and out of your shell history. Nothing is stored on disk by these commands.
Step 2: Record your current IP
echo "Direct IP: $(curl -sS https://api.ipify.org)"
echo
Write this value down. You will compare it with the proxied result later. Any IP echo service works; api.ipify.org is used here because it returns a plain address with no extra markup.
Step 3: Test the HTTP endpoint
curl -sS --proxy "http://$CM_HOST" --proxy-user "$CM_USER:$CM_PASS" https://api.ipify.org
echo
If authentication succeeds and the endpoint is reachable, the printed address differs from the direct IP from Step 2. Keep the call as an explicit curl command for now; environment variables come next.
Step 4: Test the SOCKS5 endpoint
curl -sS --socks5-hostname "$CM_HOST" --proxy-user "$CM_USER:$CM_PASS" https://api.ipify.org
echo
The --socks5-hostname form asks the proxy to resolve the destination hostname, so your local DNS resolver is not consulted for the target domain. The plain --socks5 flag resolves locally and is usually the wrong choice for privacy-focused setups.
Step 5: Set proxy environment variables for the session
export http_proxy="http://$CM_USER:$CM_PASS@$CM_HOST"
export https_proxy="$http_proxy"
export no_proxy="localhost,127.0.0.1,::1"
curl -sS https://api.ipify.org
echo
curl, wget, git, pip, and many other command-line tools read these variables automatically. The no_proxy list keeps local addresses, such as a development server on port 3000, out of the proxy tunnel.
Step 6: Add on/off helpers instead of permanent exports
# Append to ~/.bashrc or ~/.zshrc
proxy_on() {
: "${CM_HOST:?Set CM_HOST, CM_USER, and CM_PASS first}"
export http_proxy="http://${CM_USER}:${CM_PASS}@${CM_HOST}"
export https_proxy="$http_proxy"
export no_proxy="localhost,127.0.0.1,::1"
echo "HTTP/HTTPS proxy on"
}
proxy_off() {
unset http_proxy https_proxy no_proxy
echo "HTTP/HTTPS proxy off"
}
Reload the file with source ~/.bashrc, then type proxy_on when you want the tunnel and proxy_off when you do not. Leaving a proxy permanently exported is a common source of confusing failures in unrelated tools.
Step 7: Understand what the environment variables do not cover
- Browsers, Electron apps, and desktop services generally ignore shell environment variables. Set the proxy in the application or in your desktop's network settings instead.
- Background daemons such as Docker, snapd, and some package managers need their own configuration files.
- Only one global proxy can be active per shell session, so run separate terminals if you need to compare two endpoints at once.
Step 8: Confirm the change and sanity-check DNS
curl -sS https://ipinfo.io/ip; echo
curl -sS https://ipinfo.io/country; echo
The country value should match the region of the ChangeMyIP endpoint you selected. With both HTTP and the --socks5-hostname form, the proxy resolves the destination hostname, so your local resolver is not consulted for the target domain. If you also run a local DNS resolver or a transparent proxy, run a DNS leak test in a browser to confirm your queries exit where you expect.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
curl: (22) ... 407 |
Missing or wrong proxy credentials | Recheck the username and password, and pass --proxy-user explicitly |
curl: (7) Failed to connect |
Wrong host or port, or a firewall block | Copy host and port from your plan details; confirm the port is reachable |
IP is unchanged after export |
Exported in a different shell, or the tool ignores environment variables | Run proxy_on in the current shell and test with curl first |
Works with curl but not in the browser |
Browser does not read shell variables | Enter the host and port in the browser's proxy settings or the desktop network panel |
| Some sites load, others are blocked | Shared datacenter IP is flagged by the target site | Retry with a residential endpoint |
| SOCKS5 fails but HTTP works | Local DNS resolution or the wrong SOCKS flag | Use --socks5-hostname |
| Speeds vary between attempts | Shared datacenter pool congestion | Test another endpoint from a different city |
Summary
Changing your IP on Linux comes down to three things: holding valid ChangeMyIP credentials, telling the tool where to send traffic, and verifying the result. Test with curl and explicit flags first, move to http_proxy and https_proxy environment variables once that works, and expose them through proxy_on and proxy_off helpers so your normal traffic is unaffected when you are not testing. Confirm the new IP and country with an IP echo service, prefer --socks5-hostname when you want the proxy to handle DNS, and remember that graphical applications need their own proxy settings.