lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] RE: DNS. Howto Discover DNS Server?


From: Nick Thomas
Subject: [lwip-users] RE: DNS. Howto Discover DNS Server?
Date: Thu, 28 Aug 2008 16:57:38 +0100


-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf
Of Nick Thomas
Sent: 28 August 2008 14:38
To: address@hidden
Subject: [lwip-users] DNS. Howto Discover DNS Server?



> Hi,

> I notice that dns.c uses #define DNS_SERVER_ADDRESS to use a hard coded
DNS.

> Is there a way to 'discover' the nearest DNS?

> DHCP discovers my NetGear router, and obtains an IP address OK, and I can
> use this routers IP address as DNS_SERVER_ADDRESS and DNS works.
> So, is it possible to dynamically use the discovered DHCP server IP
address
> as the the DNS server, without any hardcoding?

> Or is this not the right approach.

I now see the I can discover the DNS servers. There is some code in
dhcp_handle_ack() which gives me chance to save upto two DNS server IP
address returned.
Which might give me a DNS IP address of 62.31.144.39 (for example). But, my
local IP address is 192.168.0.7.
Now when it comes to use this DNS to resolve google.co.uk (for example) I
notice that the ip_route function cannot find a network interface because my
netmask is blocking access to the DNS server!


Regards

Nick


-----------------------------
Nick Thomas
Email: address@hidden



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.6.10/1638 - Release Date: 8/27/2008
7:06 PM







reply via email to

[Prev in Thread] Current Thread [Next in Thread]