Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

Comments on How to configure custom DNS for only one Wifi network?

Parent

How to configure custom DNS for only one Wifi network?

+3
−0

One of the Wifi networks I connect to has a DNS server on it, which is better than public ones. This DNS server is not available when connected to other networks.

When I'm on this network, I want my phone to use eg. 192.168.1.2 as the DNS. When on other networks, it should use the default automatic stuff (probably Google DNS or something).

On desktops, you can configure DNS per network. However, it looks like Android only has one global setting for custom DNS. I don't want to toggle DNS globally everytime I come in and leave the range of this one network.

History

1 comment thread

Tunnel (1 comment)
Post
+2
−0

You can use static configuration. If you can get an IP address outside of the DHCP range (ask the network admin for the information if you don't administer it yourself) you can configure the network connection to use static IP configuration instead of DHCP. Configure the IP address, the gateway and your preferred DNS server and you are good.

In a modern stock Android the settings are found in:

Network and Internet -> Internet -> Cog next to "Wifi name" (⚙️) -> Pencil in the upper right corner (✏️) -> Advanced Options

Screenshot of the configuration dialog for a Wifi connection on Android. The network name is blurred, red rectangles are drawn around the edit button and the menu entry 'static' to highlight these options.

On devices from manufacturers which customize Android extensively it probably differs a little, but it should be somewhere.

These settings will then only apply to this Wifi connection, every other connection will still use DHCP to get the proper IP configuration for those networks.

History

1 comment thread

Can you explain more? (2 comments)
Can you explain more?
Michael‭ wrote 6 months ago

I'm not primarily a network admin, which is probably why I don't understand how the parts of your answer connect to each other and to the question.

I thought that a static IP was to keep a consistent address on that network. I don't understand how that helps you resolve DNS for outside connections. Is that because you then ignore that network's DNS for everything, including other computer on its subnet?

If you can get an IP address outside of the DHCP range

Is this the static IP you assign yourself? And you need to do this in order to avoid picking an IP that DHCP might assign to someone else, yes? (I've had that happen with a poorly designed VPN product. It was messy.) Or do you mean something else like "get to an IP address outside..."?

GeraldS‭ wrote 6 months ago

When you set a static IP address for a connection (the OS doesn't matter, it's the same everywhere) you configure IP address, gateway, DNS servers and related settings directly on the device. You must configure all of these settings manually, you can't just set an IP address and get the rest from DHCP, it's either one or the other. You need to either be the administrator for the network or get these settings from an admin, otherwise you risk getting a collision if the same IP address is used elsewhere. These settings will then only apply to this specific connection, every other connection that is still set to DHCP will use the settings (including DNS) it gets provided by DHCP. I'll update the screenshot to show more of said settings.