Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,768,772 Members 52,097 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Hardcoded 8.8.8.8 and 8.8.4.4?

Tip us?
 
ericbergan
Old
#1  
Member - OP
Thanks Meter 10
Posts: 79
Join Date: Sep 2007
Default [Q] Hardcoded 8.8.8.8 and 8.8.4.4?

Looking at my router logs, both my Samsung Note 2 and Note Pro 12.2 LTE (stock, not rooted) are making DNS calls to Google's DNS servers at 8.8.8.8 and 8.8.4.4 several times a minute. Neither of those servers are in my DHCP configuration, so I'm guessing something has these hard coded. Local port numbers change with each call. Our Xoom and HTC Photon 4G are not doing this, despite running many of the same applications.

I used a no-root firewall on the Note Pro which uses VPN to track activity, but it doesn't show this, and even application network traffic doesn't seem to correlate to when the Google DNS calls are made, so I'm guessing it's a system process of some kind?

Has anyone else observed this? It's more just annoying, than anything else.

Thanks for any insights!

eric
 
d8d8up
Old
#2  
Junior Member
Thanks Meter 0
Posts: 11
Join Date: Apr 2014
Quote:
Originally Posted by ericbergan View Post
Looking at my router logs, both my Samsung Note 2 and Note Pro 12.2 LTE (stock, not rooted) are making DNS calls to Google's DNS servers at 8.8.8.8 and 8.8.4.4 several times a minute. Neither of those servers are in my DHCP configuration, so I'm guessing something has these hard coded. Local port numbers change with each call. Our Xoom and HTC Photon 4G are not doing this, despite running many of the same applications.

I used a no-root firewall on the Note Pro which uses VPN to track activity, but it doesn't show this, and even application network traffic doesn't seem to correlate to when the Google DNS calls are made, so I'm guessing it's a system process of some kind?

Has anyone else observed this? It's more just annoying, than anything else.

Thanks for any insights!

eric
Hi Eric, not too sure if you got your answer already. i am on RR kitkat ROM (SGS2), i had a related issue in that it has hard coded 8.8.8.8 as DNS and as a result, i can not use most open/free wifi, the authentication/term and condition page will not come up...
with some research, i found that in /system/etc/dhcpcd/dhcpcd-hooks/, there is this file called 20-dns.conf, in there, you may find there are 2 line similar to this

setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4

if you delete/comment this out, and reboot the device, it should work hopefully. that is how i fixed mine anyway. let me know if you still stuck.

cheers.
 
d8d8up
Old
#3  
Junior Member
Thanks Meter 0
Posts: 11
Join Date: Apr 2014
Quote:
Originally Posted by d8d8up View Post
Hi Eric, not too sure if you got your answer already. i am on RR kitkat ROM (SGS2), i had a related issue in that it has hard coded 8.8.8.8 as DNS and as a result, i can not use most open/free wifi, the authentication/term and condition page will not come up...
with some research, i found that in /system/etc/dhcpcd/dhcpcd-hooks/, there is this file called 20-dns.conf, in there, you may find there are 2 line similar to this

setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4

if you delete/comment this out, and reboot the device, it should work hopefully. that is how i fixed mine anyway. let me know if you still stuck.

cheers.
just to show the whole picture so someone else can save a bit of running around, here is a file very similar to the orginal 20-dns.conf note line 20 and 20, if you # it out, it should use the default gateway, or change it so it use one you prefer: ( this is copied from the github but i can not copy the like over due to new user restriction.)

# Set net.<iface>.dnsN properties that contain the
# DNS server addresses given by the DHCP server.

set_dns_props()
{
case "${new_domain_name_servers}" in
"") return 0;;
esac

count=1
for i in 1 2 3 4; do
setprop dhcp.${interface}.dns${i} ""
done

count=1
for dnsaddr in ${new_domain_name_servers}; do
setprop dhcp.${interface}.dns${count} ${dnsaddr}
count=$(($count + 1))
done

setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4
}

unset_dns_props()
{
for i in 1 2 3 4; do
setprop dhcp.${interface}.dns${i} ""
done
}

case "${reason}" in
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT) set_dns_props;;
EXPIRE|FAIL|IPV4LL|RELEASE|STOP) unset_dns_props;;
esac
 
ericbergan
Old
#4  
Member - OP
Thanks Meter 10
Posts: 79
Join Date: Sep 2007
Quote:
Originally Posted by d8d8up View Post
Hi Eric, not too sure if you got your answer already. i am on RR kitkat ROM (SGS2), i had a related issue in that it has hard coded 8.8.8.8 as DNS and as a result, i can not use most open/free wifi, the authentication/term and condition page will not come up...
with some research, i found that in /system/etc/dhcpcd/dhcpcd-hooks/, there is this file called 20-dns.conf, in there, you may find there are 2 line similar to this

setprop dhcp.eth0.dns1 8.8.8.8
setprop dhcp.eth0.dns2 8.8.8.4

if you delete/comment this out, and reboot the device, it should work hopefully. that is how i fixed mine anyway. let me know if you still stuck.

cheers.
Thanks for the pointer, but unfortunately that's not my issue. I checked the file, and there are no hard coded addresses.

I don't think it is at the system level - when I look at the network configuration, it is showing the correct DNS addresses to use. So I think it is one or more apps that have it hard coded. Since I'm only seeing it on my Samsung devices, I'm guessing it's one of theirs...
 
d8d8up
Old
#5  
Junior Member
Thanks Meter 0
Posts: 11
Join Date: Apr 2014
oh... weird indeed. when i was trying to fix mine at the very beginning, i went to the wifi set up and found it was using DHCP, i therefore assumed it had no custom DNS but the router address as the DNS, which would be good and normal for me. but when i run getprop net.dns1 via the terminal of the phone, it gave me the 8.8.8.8 address.which led to the file mentioned above...
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes