RE: DNS for multi-interfaces host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yuan Huailin-w19410 wrote:

> > > In windows OS, we can set DNS for TCP/IP of every
> > > connection(interface).
> > 
> > > For example, I have 2 ethernet interfaces which connect to 2
> > > different private network, I can set DNS for each of them.
> > 
> > By "DNS", do you mean "DNS server"? If so, the above doesn't make any
> > sense. What determines which interface (and hence, which server) is
> > chosen when you perform a DNS query?
> 
> Yes, I mean DNS server.
> 
> This bring another question, When network application want to connect
> a host, how does it choice the interface?

Once it has resolved the hostname to an IP address, it uses connect()
to connect to that IP address. The kernel will choose the appropriate
interface by looking up the destination IP address in the routing
table. However, the decision can't be made until the hostname has been
resolved to an IP address.

Similarly, whilst you could choose the DNS server to which a query is
sent based upon a number of factors, clearly you can't base the choice
upon the IP address which that query will ultimately return because
you don't know the result until after you have sent the query.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux