Networking

- resolve a domain to IP address
This commit is contained in:
bonnie 2020-07-19 21:22:40 +08:00
parent d7a768c446
commit 46bda81c1a

View File

@ -2289,11 +2289,15 @@ ipmitool -I bmc lan set 1 defgw ipaddr 192.168.0.1
## Networking ## Networking
[[back to top](#handy-bash-one-liners)] [[back to top](#handy-bash-one-liners)]
##### Resolve a domain to an IP address in a Bash script? ##### Resolve a domain to IP address(es)
```bash ```bash
dig +short www.example.com dig +short www.example.com
# or
host www.example.com
``` ```
##### Send a ping with a limited TTL to 10 (TTL: Time-To-Live, which is the maximum number of hops that a packet can travel across the Internet before it gets discarded.) ##### Send a ping with a limited TTL to 10 (TTL: Time-To-Live, which is the maximum number of hops that a packet can travel across the Internet before it gets discarded.)
```bash ```bash
ping 8.8.8.8 -t 10 ping 8.8.8.8 -t 10