You are not logged in.

#1 2022-11-17 13:00:17

asklow
Member
Registered: 2022-11-07
Posts: 19

[SOLVED] can user override local dns resolve.conf ?

Is /etc/resolve.conf the only way to modify ethernet dns ? Is there any non previleged user way of doing this ?

Last edited by asklow (2022-11-17 14:10:01)

Offline

#2 2022-11-17 13:10:51

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,448
Website

Re: [SOLVED] can user override local dns resolve.conf ?

How are you bringing up your network?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2022-11-17 13:16:19

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

graysky wrote:

How are you bringing up your network?

Just via ethernet. It does have a router, but I neither have permissions for router configuration, nor host root previleges.

Last edited by asklow (2022-11-17 13:17:31)

Offline

#4 2022-11-17 13:19:08

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,448
Website

Re: [SOLVED] can user override local dns resolve.conf ?

I mean how are you managing it?  systemd-networkd?  something else?  My point is that whatever you're using may allow for what you're asking to do.  I do not know about an non-privileged option though...  custom DNS is better setup on your router if it needs to be non-root user.

Last edited by graysky (2022-11-17 13:19:39)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2022-11-17 13:20:24

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

graysky wrote:

I mean how are you managing it?  systemd-networkd?  something else?  My point is that whatever you're using may allow for what you're asking to do.  I do not know about an non-privileged option though...  custom DNS is better setup on your router if it needs to be non-root user.

It's networkmanager

Offline

#6 2022-11-17 13:23:44

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

It did try

nmcli connection modify Wired\ connection\ 1 ipv4.dns "1.1.1.1 1.0.0.1"

but I'm not sure if it worked or not.

Offline

#7 2022-11-17 13:27:30

seth
Member
Registered: 2012-09-03
Posts: 33,676

Re: [SOLVED] can user override local dns resolve.conf ?

nslookup google.com
dig google.com

They tell you the server.

Edit: this seems very much an xy-problem.
What are you actually trying to achieve? Why do you need an unprivileged user to alter the DNS stack?

Last edited by seth (2022-11-17 13:28:15)

Online

#8 2022-11-17 13:34:48

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

seth wrote:
nslookup google.com
dig google.com

They tell you the server.

Looks like my host machine doesn't have extra/bind package so can't use nslookup.

Although

nmcli connection show Wired\ connection\ 1 | grep ipv4.dns:

shows what I've set before (1.1.1.1,1.0.0.1). But I still couldn't able to unblock the sites that were blacklisted via router dns.

I do have an android smartphone (connected through router's wifi). And it has Settings >  Network & Internet > Private DNS feature where I can specify dns hostname & able to unblock router blacklisted sites. And it's not rooted btw.

It's just an example anyways. Was wondering if I could do the same on linux without previleges.

Last edited by asklow (2022-11-17 13:38:39)

Offline

#9 2022-11-17 13:45:39

seth
Member
Registered: 2012-09-03
Posts: 33,676

Re: [SOLVED] can user override local dns resolve.conf ?

I do have an android smartphone

Yeah, that's completely irrelevant - of course any OS will allow you to configure a DNS, it's just that "your" "arch" linux (whatever that actually is) will require root rights to do so globally.
Mulitple clients (especially browsers) will allow you to configure the DNS independently.

What are you specifically trying to do and why don't you have root access to the system?

my host machine doesn't have extra/bind

Do you have drill?

Online

#10 2022-11-17 13:45:52

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

seth wrote:

What are you actually trying to achieve? Why do you need an unprivileged user to alter the DNS stack?

To unblock my workplace router blacklisted sites. The host machines are configured via arch with Ethernet.

One way I could hack around, is to connect router wifi on my Android device & use USB Tethering to access internet on my host machine. But it's more of a "touch your nose from backwards" case.

Offline

#11 2022-11-17 13:49:03

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

seth wrote:

Do you have drill?

Yes. ldns exists, as it comes with openssh.

Last edited by asklow (2022-11-17 13:51:19)

Offline

#12 2022-11-17 14:09:31

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

Okay. I've figured it out.

nmcli connection modify Wired\ connection\ 1 ipv4.dns "1.1.1.1 1.0.0.1"

actually worked. I just needed to reload ethernet via

nmcli device reapply enp4s0

Offline

#13 2022-11-17 14:11:17

seth
Member
Registered: 2012-09-03
Posts: 33,676

Re: [SOLVED] can user override local dns resolve.conf ?

Well, then test drill.

To unblock my workplace router blacklisted sites.

seth wrote:

Mulitple clients (especially browsers) will allow you to configure the DNS independently.

You're not supposed to watch porn on your employers hardware from within your employers network, though.

Online

#14 2022-11-17 14:11:27

progandy
Member
Registered: 2012-05-17
Posts: 5,048

Re: [SOLVED] can user override local dns resolve.conf ?

The company network may simply reroute any DNS request to its own server. On android you chose to use "Private DNS", which uses DNS over TLS. You should be able to choose DNS over TLS with networkmanager if it is set up with systemd-resolved.

You should be aware, that circumventing their dns blocks could result in contractual consequences, maybe even losing your job.

Last edited by progandy (2022-11-17 14:14:44)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#15 2022-11-17 14:14:23

asklow
Member
Registered: 2022-11-07
Posts: 19

Re: [SOLVED] can user override local dns resolve.conf ?

seth wrote:

You're not supposed to watch porn on your employers hardware from within your employers network, though.

Oh, no lol. They just happened to block social media websites such as youtube, twitter, reddit, etc... Fixed via nmcli con mod & device reapply anyways

(offtopic) My workplace ain't a company, rather a group of team that work together (badluck that I got a weird boss who happened to be tech savvy)...

Last edited by asklow (2022-11-17 14:17:23)

Offline

#16 2022-11-17 15:48:15

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 957

Re: [SOLVED] can user override local dns resolve.conf ?

asklow wrote:

team that work together [...] I got a [...] boss

I think that's indistinguishable from what I would call a company. Circumventing corporate IT / security policy is a sure-fire way to torpedo your career beyond just this job. If you don't like their policy, quit instead of trying to circumvent it.

Offline

Board footer

Powered by FluxBB