5,594,564 Members 32,417 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Help! Changing DNS settings

Tip us?
 
tiptoekirk
Old
#1  
Senior Member - OP
Thanks Meter 10
Posts: 164
Join Date: Feb 2007
Location: Washington DC
Default [Q] Help! Changing DNS settings

I need to change the DNS settings for a connection I use a lot that is managed by company who has setup OpenDNS to block a lot of stuff...

How can I go about doing this on a wpa encrypted wireless network where i do no not have a dynamic ip address?? It seems it only supports changing a DNS server when the phone is setup dynamically.. I need it to work on DHCP, I just need the DNS server changed, i dont need or want a dynamic ip..

HELP!
Phones in House
2 Sony Xperia Z1s
iPhone 5s - Jailbroken
Tablets in House
Nexus 7 1st Gen - Rooted, Custom ROM
Nexus 7 2nd Gen - Rooted
Nabi 2 Tablet - Rooted, GAPPS installed
Kindle Fire - Stock
iPad 2 - Jailbroken
Extras in house
2 Chromecast devices
Samsung Chromebook
MacBook Pro
and 2 desktops...

Yes WAY too many devices for a small family of 4 to own but it keeps the kids quiet on car rides
 
henihazbay
Old
#2  
henihazbay's Avatar
Member
Thanks Meter 2
Posts: 61
Join Date: Jan 2010
Quote:
Originally Posted by tiptoekirk View Post
I need to change the DNS settings for a connection I use a lot that is managed by company who has setup OpenDNS to block a lot of stuff...

How can I go about doing this on a wpa encrypted wireless network where i do no not have a dynamic ip address?? It seems it only supports changing a DNS server when the phone is setup dynamically.. I need it to work on DHCP, I just need the DNS server changed, i dont need or want a dynamic ip..

HELP!
This is the code needed to change the DNS settings. Just connect your N1 to your PC and open command in your PC then;

adb shell setprop net.dns1 8.8.8.8

adb shell setprop net.dns2 8.8.8.4
Nexus One
 
tiptoekirk
Old
#3  
Senior Member - OP
Thanks Meter 10
Posts: 164
Join Date: Feb 2007
Location: Washington DC
Quote:
Originally Posted by henihazbay View Post
This is the code needed to change the DNS settings. Just connect your N1 to your PC and open command in your PC then;

adb shell setprop net.dns1 8.8.8.8

adb shell setprop net.dns2 8.8.8.4
That did not seem to do it... I tried several times with wifi on and off and even restarted the phone.. any other ideas??
Phones in House
2 Sony Xperia Z1s
iPhone 5s - Jailbroken
Tablets in House
Nexus 7 1st Gen - Rooted, Custom ROM
Nexus 7 2nd Gen - Rooted
Nabi 2 Tablet - Rooted, GAPPS installed
Kindle Fire - Stock
iPad 2 - Jailbroken
Extras in house
2 Chromecast devices
Samsung Chromebook
MacBook Pro
and 2 desktops...

Yes WAY too many devices for a small family of 4 to own but it keeps the kids quiet on car rides
 
yasn77
Old
#4  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Jan 2008
Location: London
Quote:
Originally Posted by tiptoekirk View Post
I need to change the DNS settings for a connection I use a lot that is managed by company who has setup OpenDNS to block a lot of stuff...

How can I go about doing this on a wpa encrypted wireless network where i do no not have a dynamic ip address?? It seems it only supports changing a DNS server when the phone is setup dynamically.. I need it to work on DHCP, I just need the DNS server changed, i dont need or want a dynamic ip..

HELP!
Not sure if i get that... When you use static ip there is a section that allows you to specify the DNS... not sure what you mean The problem as i see it, is that there is no easy way (via android GUI) of changing DNS if you use DHCP

Anyways... try...

adb shell setprop dhcp.eth0.dns1 <IP>
adb shell setprop dhcp.eth0.dns2 <IP>
etc

This will only change the DNS server. If you know shell scripting, You could make this more permanent by editing :

/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf

If that works, and you are unfamiliar with shell scripting, then post some conditions (i.e SSID of network, gw of network etc) and i'll see if i can knock something up for you.

Hope that helps
 
tiptoekirk
Old
#5  
Senior Member - OP
Thanks Meter 10
Posts: 164
Join Date: Feb 2007
Location: Washington DC
Quote:
Originally Posted by yasn77 View Post
Not sure if i get that... When you use static ip there is a section that allows you to specify the DNS... not sure what you mean The problem as i see it, is that there is no easy way (via android GUI) of changing DNS if you use DHCP

Anyways... try...

adb shell setprop dhcp.eth0.dns1 <IP>
adb shell setprop dhcp.eth0.dns2 <IP>
etc

This will only change the DNS server. If you know shell scripting, You could make this more permanent by editing :

/system/etc/dhcpcd/dhcpcd-hooks/20-dns.conf

If that works, and you are unfamiliar with shell scripting, then post some conditions (i.e SSID of network, gw of network etc) and i'll see if i can knock something up for you.

Hope that helps
Yes i am wanting to just change the DNS server that my phone uses when connecting to wifi but i cant set it up dynamically so i am forced to keep it dhcp.

i tried the way you said and it didn't do it.. this android stuff is new to me.. after i type in that command in it does not say anything.. i have rooted and unlocked my nexus one and pretty good with computers but this linux stuff is another ballgame..

ive done some dos scripting back in the day, is this anything similar? what other info would u need from me to create the file? SSID, password, ??

THANKS!
Phones in House
2 Sony Xperia Z1s
iPhone 5s - Jailbroken
Tablets in House
Nexus 7 1st Gen - Rooted, Custom ROM
Nexus 7 2nd Gen - Rooted
Nabi 2 Tablet - Rooted, GAPPS installed
Kindle Fire - Stock
iPad 2 - Jailbroken
Extras in house
2 Chromecast devices
Samsung Chromebook
MacBook Pro
and 2 desktops...

Yes WAY too many devices for a small family of 4 to own but it keeps the kids quiet on car rides
 
white^rabbit
Old
#6  
white^rabbit's Avatar
Member
Thanks Meter 0
Posts: 96
Join Date: Mar 2010
Location: Verona
How to set the dns for the mobile internet connection?! I wanna use FoolDNS in place of Google DNS.. Because with froyo 2.2 and flashplayer we see allllllll the advertising on web and navigation becames much slower:)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

[APK] YouTube Update to 5.6 Now Lets You Cast Live Video to Your Chromecast

Earlier today, we talked about how Google brought two new apps to … more

[OTA Captured] Android 4.4.2 Now Rolling Out to the AT&T Galaxy S 4 Active

A little under two months ago, AT&T started rolling out … more

HTC Releases Dual Lens SDK for the HTC One M8 (2014)

One of the highlights of the HTC One M8is its new dual lens camera system. Termed … more