dns-fix?!

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
cbrevard
Level 1
Level 1
Posts: 6
Joined: Thu May 23, 2019 9:01 am

dns-fix?!

Post by cbrevard » Sat Sep 07, 2019 10:03 am

In the process of trying to diagnose an apparent caching problem, I came across the command `dns-fix`.

Unfamiliar with it, I ran `man dns-fix`. No result. `dns-fix -h`. Again, nothing. Ditto for `dns-fix --help`. Finally, after running `dns-fix` alone, with no arguments and receiving no response in the way of errors and usage, I opened the file to see what it contained.

Code: Select all

$ which dns-fix
/usr/bin/dns-fix
$ less `which dns-fix`

#!/bin/bash
sudo cp /usr/share/linuxmint/mintsystem/templates/resolv.conf /etc/resolv.conf
Here's why I've got a problem with this:
  1. It's not only undocumented, it doesn't even have usage.
  2. It invokes sudo on the part of the user.
  3. It overwrites a system configuration file without warning.
I can maybe see an argument for 2, but otherwise, this "script" is a horrible kludge. Why does it exist?
Last edited by cbrevard on Sat Sep 07, 2019 3:09 pm, edited 1 time in total.

User avatar
phd21
Level 19
Level 19
Posts: 9178
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: dns-fix?!

Post by phd21 » Sat Sep 07, 2019 11:17 am

Hi cbrevard,

It would certainly help if you explained what type of DNS problem you are having. Have you recently changed your DNS servers, if so how?

I am not familiar with that program "dns-fix" or its usage, but normally all anyone has to do is to clear the DNS cache.

linux ubuntu 18.04 clear dns cache - Google Search
https://www.google.com/search?sxsrf=ACY ... CAs&uact=5

Hope this helps ...
Phd21: Mint KDE 18.3 & 19, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

rene
Level 11
Level 11
Posts: 3658
Joined: Sun Mar 27, 2016 6:58 pm

Re: dns-fix?!

Post by rene » Sat Sep 07, 2019 11:22 am

It is part of "mintsystem", an itself horrible kludge that seems to exist to re-mintify things that an update directly from Ubuntu may have de-mintified. See primarily /usr/lib/linuxmint/mintsystem/mint-adjust.py and /usr/share/linuxmint/adjustments. As far as I can see dns-fix is in fact not ever called on my 19.2 Cinnamon system; I suppose it might be if some package out there installs a specific "adjustment" that makes use of it.

I remember once throwing up inside my mouth a little when looking at a mintsystem adjustment that IIRC changed an "Ubuntu" in grub.cfg to "Linux Mint" after a grub update and therethrough frustrated a personal fixup. Be honest: if you had devised/deployed a system quite as horribly kludgy as it, would you have documented it for all the world to see?

cbrevard
Level 1
Level 1
Posts: 6
Joined: Thu May 23, 2019 9:01 am

Re: dns-fix?!

Post by cbrevard » Sat Sep 07, 2019 3:53 pm

phd21 wrote:
Sat Sep 07, 2019 11:17 am
Hi cbrevard,

It would certainly help if you explained what type of DNS problem you are having. Have you recently changed your DNS servers, if so how?

I am not familiar with that program "dns-fix" or its usage, but normally all anyone has to do is to clear the DNS cache.

linux ubuntu 18.04 clear dns cache - Google Search
https://www.google.com/search?sxsrf=ACY ... CAs&uact=5

Hope this helps ...
Thanks for the reply, phd21. I attempted to clear the DNS cache with `sudo /etc/init.d/dns-clean restart`, but see now that `sudo systemd-resolve - -flush-caches` is perhaps the better of the two.

But that's not really what I'm driving at in questioning the existence or nature of this one-line executable, though.

gm10
Level 18
Level 18
Posts: 8737
Joined: Thu Jun 21, 2018 5:11 pm

Re: dns-fix?!

Post by gm10 » Sat Sep 07, 2019 4:01 pm

cbrevard wrote:
Sat Sep 07, 2019 10:03 am
Here's why I've got a problem with this:
  1. It's not only undocumented, it doesn't even have usage.
  2. It invokes sudo on the part of the user.
  3. It overwrites a system configuration file without warning.
Sure it has a usage, it quickly replaces your DNS configuration with google's DNS servers and circumvents systemd-resolved, and as such is a useful troubleshooting tool. The system configuration will be restored after a reboot, and nobody at all is forcing you to use it. /shrug

It's a Mint-specific command btw.
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

cbrevard
Level 1
Level 1
Posts: 6
Joined: Thu May 23, 2019 9:01 am

Re: dns-fix?!

Post by cbrevard » Sat Sep 07, 2019 5:46 pm

gm10 wrote:
Sat Sep 07, 2019 4:01 pm
cbrevard wrote:
Sat Sep 07, 2019 10:03 am
Here's why I've got a problem with this:
  1. It's not only undocumented, it doesn't even have usage.
  2. It invokes sudo on the part of the user.
  3. It overwrites a system configuration file without warning.
Sure it has a usage, it quickly replaces your DNS configuration with google's DNS servers and circumvents systemd-resolved, and as such is a useful troubleshooting tool. The system configuration will be restored after a reboot, and nobody at all is forcing you to use it. /shrug

It's a Mint-specific command btw.
When I stated that it "doesn't even have usage" I meant that the user is not given the typical one-line summary of invocation and accepted arguments that is provided by nearly all linux utilities.

A useful troubleshooting tool? Do Mint users need to troubleshoot DNS so often that they need an alias for a trivial invocation of `cp` in their PATH?

"Nobody is forcing you to use it". That's a great argument for including arbitrary executable files in the system path.

gm10
Level 18
Level 18
Posts: 8737
Joined: Thu Jun 21, 2018 5:11 pm

Re: dns-fix?!

Post by gm10 » Sat Sep 07, 2019 5:58 pm

If you look hard enough I'm sure you can find fault with just about anything...
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

cbrevard
Level 1
Level 1
Posts: 6
Joined: Thu May 23, 2019 9:01 am

Re: dns-fix?!

Post by cbrevard » Sat Sep 07, 2019 6:40 pm

gm10 wrote:
Sat Sep 07, 2019 5:58 pm
If you look hard enough I'm sure you can find fault with just about anything...
You're right, no distro is perfect. And rather than kvetch about this and do nothing to improve the situation, or simply accept it because I'm biased toward Mint, I'll contact the maintainer of the package to see if it can't be removed or improved.

gm10
Level 18
Level 18
Posts: 8737
Joined: Thu Jun 21, 2018 5:11 pm

Re: dns-fix?!

Post by gm10 » Sat Sep 07, 2019 7:17 pm

cbrevard wrote:
Sat Sep 07, 2019 6:40 pm
gm10 wrote:
Sat Sep 07, 2019 5:58 pm
If you look hard enough I'm sure you can find fault with just about anything...
You're right, no distro is perfect. And rather than kvetch about this and do nothing to improve the situation, or simply accept it because I'm biased toward Mint, I'll contact the maintainer of the package to see if it can't be removed or improved.
By all means. You could even just go and contribute the manual for it if you want. Mint is "traditionally" lacking in documentation - I added a bunch of manual pages for 19.2 but you'd be very welcome to contribute more of them. ;)
Tune up your LM 19.x: ppa:gm10/linuxmint-tools

rene
Level 11
Level 11
Posts: 3658
Joined: Sun Mar 27, 2016 6:58 pm

Re: dns-fix?!

Post by rene » Sat Sep 07, 2019 8:23 pm

cbrevard wrote:
Sat Sep 07, 2019 3:53 pm
But that's not really what I'm driving at in questioning the existence or nature of this one-line executable, though.
The other, relevant reply you got went unanswered though, so what are you driving at? dns-fix is as said part of the "mintsystem" package, which comprises the core of an "adjustment" infrastructure, and specific other packages install specific further "adjustments" into /usr/share/linuxmint/adjustments. I.e., on this Xfce system, and as to the packages I have in fact installed,

Code: Select all

$ dpkg -S /usr/share/linuxmint/adjustments/
ubuntu-system-adjustments, mintlocale, mintdesktop, mint-artwork, mintsystem: /usr/share/linuxmint/adjustments
I would expect there to be or semi-recently have been a package I do not have installed that in fact makes use of dns-fix. It's also in nature of no other kludginess than all the rest of "mintsystem", so what remains to be questioned?

Post Reply

Return to “Other networking topics”