Score:0

How do I script resolve.conf to force only a specific url to use a DNS in Ubuntu 21.10

in flag

Here is my current /etc/resolvconf/resolv.conf.d/head file in Ubuntu 21.10

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

nameserver 185.228.168.10
nameserver 185.228.169.11

As you can see, I am using a kind of parental safe DNS as my global DNS.

Now I want to do something like this:

nameserver 185.228.168.10
nameserver 185.228.169.11
www.youtube.com 1.1.1.1

So that only YouTube uses a different DNS.

I would be happy if this file can be scriptable in this way. I don't want to use some convoluted method.

This is my current situation. The parental DNS goes too far in my opinion, by locking YouTube into restricted mode. YouTube is the only URL that I want to use a specific DNS.

My Android Phone is currently able to do this with Blokada app. Blokada app can set a global DNS-VPN for the parental DNS and then I can choose to "bypass" youtube. This allows me to get the exact result that I want with an android phone. My trouble here is in getting this to work on Ubuntu 21.10

Joshua Robison avatar
in flag
your comment is unrelated to the issue and should be removed. Please discuss issues like this in meta.askubuntu.com @guiverc
Joshua Robison avatar
in flag
This is not the place to discuss meta. Please move this discussion to the chat.
chili555 avatar
cn flag
Please try adding this line to /etc/hosts: `172.253.124.93 youtube.com` Confirm the correct address with ping4.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.