|
|
|
|
|
by capableweb
1432 days ago
|
|
IP/TCP (unsurprisingly) works over IPs, not domains, which is over DNS, so there are one step involved before actually making the requests (simplified obviously). With that said, you could try to limit things based on the IP range of the resolved IP of a domain. Other services the same company runs might be a casualty in this cross-fire, but maybe that's not a problem. Make this: $ comcast --device=eth0 --latency=250 --target-bw=1000 --default-bw=1000000 --packet-loss=10% --target-addr=8.8.8.8,10.0.0.0/24 --target-proto=tcp,udp,icmp
Into this: $ comcast --device=eth0 --latency=250 --target-bw=1000 --default-bw=1000000 --packet-loss=10% --target-addr=$(whois $(dig +short google.com a) | grep -i cidr | cut -d ':' -f 2 | xargs) --target-proto=tcp,udp,icmp
The `whois ... dig .. grep cidr` stuff gets a CIDR from the currently resolved IP address from a DNS query. So probably you want to add this as a systemd service or something, which restarts each five minutes or something (as what the dig command returns will change over time), and you probably want to add multiple domains (like the domains they use for APIs, CDNs and so on) as well. |
|