diff --git a/README.md b/README.md index de2bd0c..0e931a9 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_805 TILs and counting..._ +_806 TILs and counting..._ --- @@ -113,6 +113,7 @@ _805 TILs and counting..._ - [Path Of The Packets](devops/path-of-the-packets.md) - [Push Non-master Branch To Heroku](devops/push-non-master-branch-to-heroku.md) - [Reload The nginx Configuration](devops/reload-the-nginx-configuration.md) +- [Resolve The Public IP Of A URL](devops/resolve-the-public-ip-of-a-url.md) - [Running Out Of inode Space](devops/running-out-of-inode-space.md) - [Wipe A Heroku Postgres Database](devops/wipe-a-heroku-postgres-database.md) diff --git a/devops/resolve-the-public-ip-of-a-url.md b/devops/resolve-the-public-ip-of-a-url.md new file mode 100644 index 0000000..4e413a6 --- /dev/null +++ b/devops/resolve-the-public-ip-of-a-url.md @@ -0,0 +1,38 @@ +# Resolve The Public IP Of A URL + +The `dig` command is a utility for doing DNS lookups. You can run it with a +URL argument to lookup the public IP for that domain. + +```bash +$ dig joshbranchaud.com + +; <<>> DiG 9.8.3-P1 <<>> joshbranchaud.com +;; global options: +cmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62836 +;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0 + +;; QUESTION SECTION: +;joshbranchaud.com. IN A + +;; ANSWER SECTION: +joshbranchaud.com. 1800 IN A 159.203.106.229 + +;; Query time: 50 msec +;; SERVER: 75.75.75.75#53(75.75.75.75) +;; WHEN: Sun Apr 14 12:34:52 2019 +;; MSG SIZE rcvd: 51 +``` + +The output is a bit noisy, but if you parse down to the _ANSWER SECTION_, +you'll see the IP address that it resolves to. + +Alternatively, you can skip the noise and get right to the IP address by +including the `+short` flag. + +```bash +$ dig joshbranchaud.com +short +159.203.106.229 +``` + +See `man dig` for more details.