We have numerous laptops here which have two adjacent DHCP reservations, one for the wired interface, and the next for the wireless. This allows simpler firewall rules by using (e.g.) /28 subnets for all NICs on all laptops in given department.
NSLOOKUP properly returns both interfaces when querying a machine:
$ auk
Server: ourcompany-dc3.ourinternaldomain.local
Address: 192.168.28.9
Name: auk.ourinternaldomain.local
Addresses: 192.168.28.79 192.168.28.78
I'm looking for a single ping command that will try both NICs to see which one is connected. And it should be by name, not address.
However, if I ping by name, it only tries one of the machine's NICs, which only works half the time (depending on which way the user is currently connected). Obviously, I could do the NSLOOKUP first, and then try pinging both addresses, but this is what I am trying to avoid: I want to simply ping a name to see how a specific machine is attached.
Is there a ping (or dig, or anything else, for that matter) option that will automatically try all a host's NICs as found by a DNS lookup?
PS: I do know how to write a script to do this, but I'd have to drag the script around to every machine I might be using (or put it on a share), which is more trouble than it's worth.