原理 $ host test.dev1.jinbo.com test.dev1.jinbo.com has address 192.168.10.1 批量获取一组机器的IP地址 for i in {1..5}; do host test.dev${i}.jinbo.com | awk '{print $4}'; done; 192.168.10.1 192.168.10.2 192.168.10.3 192.168.10.4 192.168.10.5