in the file /etc/resolv.conf, we can assign IP address of DNS server with nameserver keyword.
When the DNS query UDP packet is sent, kernel can know which interface this packet will go to.
So, DNS setting for every interface has its meaning.
I don't know how did the Windows system implement it, Where the DNS server information is stored?
From: Glynn Clements [mailto:firstname.lastname@example.org]
Sent: Wednesday, November 20, 2002 3:09 PM
To: Yuan Huailin-w19410
Subject: RE: DNS for multi-interfaces host
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 <email@example.com> - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to firstname.lastname@example.org More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to email@example.com More majordomo info at http://vger.kernel.org/majordomo-info.html
This archive was generated by hypermail 2b29 : Sat Nov 23 2002 - 22:00:00 EST