Then you are doing something VERY strange. DNS is a service provided to hosts (systems, i.e. your phone) by "the network". It is not something that is under the control of the application. Generally, a DHCP server (or the wireless carrier) will supply you with your IP address, default router, DNS servers, and other network configuration when you connect. It's a property of your NETWORK environment.
Of course, applications are free to use IP addresses, and to obtain them however they choose -- including implementing a DNS client themselves. This, of course, raises the question -- how do you locate your "special" DNS server -- and why is it special? Is it even reachable in a particular environment? To prevent DNS spoofing attacks, some network administrators may block external DNS requests, and force you to go through their DNS servers. Generally speaking, ANY DNS server should be able to resolve ANY public DNS entry. And ONLY your local one that your network would tell you about, would be able to tell you about special, local, DNS entries. About the only use I can see for such a scheme would be to contact a botnet controller. Or, more likely, to work around a mis-configured local network -- perhaps due to a poorly set-up VPN. But in any event, an application should NOT try to hijack the entire system's DNS resolution by hacking *hosts/**resolv**.**conf. This is not "playing nice with others". There's a reason -- many reasons -- these files require root access. On Feb 3, 7:28 am, Android Development <[email protected]> wrote: > What if the application requires to send a query to a DNS server installed > at a particular IP address. > > how do i configure my DNS server in *hosts/**resolv**.**conf from the > application ?* > *** > * > > > > On Wed, Feb 3, 2010 at 8:40 PM, Lewske Wada <[email protected]> wrote: > > Hi Radhika, > > > radhika wrote: > > > Hi All, > > > > Am a beginner in this area. I am trying to find out how a DNS query > > > is sent from the android device. > > > > Am unable to locate the code. > > > > Can someone help me by showing me the code where a DNS query is sent. > > > > For example, may be from some application like browser? > > > I believe you simply have to use InetAddress.getByName(String Host) ? > > Like I did use InetAddress's getLocalHost() in resetConnection() > > funcion in my local app? : > > >http://run.sh/repos/Runftp/src/sh/run/Runftp/FtpConsoleText.java > > > Anyway the Socket() automatically resolves the hostname when given. > > > Ryu > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected]<android-developers%2Bunsubs > > [email protected]> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

