mirror of
				https://github.com/onceupon/Bash-Oneliner.git
				synced 2025-11-04 07:01:05 +01:00 
			
		
		
		
	Networking
- resolve a domain to IP address
This commit is contained in:
		@@ -2289,11 +2289,15 @@ ipmitool -I bmc lan set 1 defgw ipaddr 192.168.0.1
 | 
			
		||||
## Networking
 | 
			
		||||
[[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
 | 
			
		||||
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.)
 | 
			
		||||
```bash
 | 
			
		||||
ping 8.8.8.8 -t 10
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user