Is it possible to direct all incoming connections from NIC1 for say www.google.com only to NIC3 and others say for www.a.com, www.b.com, www.c.com to NIC2?
The answer is sort of, but it's a bad idea. Iptables lives at Layer-3/Layer-4 and thus isn't really designed to deal with DNS names. If I recall correctly if you specify redirect or forwarding rules using DNS names instead of IP addresses or netblocks, iptables will accept that information and dutifully try to resolve those names appropriately.
There are a couple of problems with this approach:
- It's a security issue. Hosts can manipulate how your firewall handles traffic by manipulating DNS. This is easier to do than you think. Your introducing complexity that isn't needed. Complexity that is unnecessary will eventually bite you.
- iptables will need to do the DNS lookups at some point to determine what IPs those domain name's resolve to. I'm not sure when iptables does the DNS lookups but if it's at load time then you can expect the IP addresses to go stale over time, especially for big domains like google. Furthermore iptables will load before the name service in the boot order and I'm not sure how that will effect things. If it's on-the-fly, you are adding quite a bit of overhead as each packet will require a DNS lookup.
What you're really looking for is a load balancing solution that is conversant in Layer-7 protocols, namely HTTP. I think Squid could probably be configured to do this - it at the very least it is a good place to start.
EDIT: Doesn't look like Squid will do what you want (it does reverse proxy load balancing for HTTP). I'm not sure why you'd want to Layer-7 aware outbound load balancing anyway - what problem are you actually trying to solve?