Project

General

Profile

Bug #681

Disabling DNS not working

Added by rgmhtt almost 10 years ago. Updated about 8 years ago.

Status:
Feedback
Priority:
Medium
Assignee:
-
Category:
DNS
Target version:
-
Start date:
11/24/2010
Due date:
% Done:

0%


Description

I disabled the service DNS. I don't want the server to run DNS, rather point it to my REAL DNS server.

After a LOT of fiddling, I thought I had everything working and rebooted. Rebooting rewrote at least:

/etc/resolv.conf
/etc/hosts

I ASSUME it rewrote /etc/sysconfig/network-scripts/ifcfg-eth0, but I did not need that to have any different content.

So disabling DNS does NOT do enough. resolv.conf and hosts at least MUST be left alone or just disallow disabling DNS.

History

#1 Updated by rgmhtt almost 10 years ago

If you disable DNS, then /usr/bin/hdactl needs the following to happen:

In sub print_network, instead of:

printf $RSLV "nameserver $net.$self\n";

You instead need:

printf $RSLV "nameserver $dns1\n";
printf $RSLV "nameserver $dns2\n";

Provided $dns2 is not null.

This will result in /etc/resolv.conf pointing to the right place(s). There might be other changes needed, I will be testing some more. Sorry I cannot give you the complete changes needed in hdactl; I don't know how to detect DNS is off, or how to check that $dns2 is not null.

#2 Updated by rgmhtt almost 10 years ago

  • Status changed from New to Feedback

I just worked out that you also have to 'fix' ifcfg-eth0:

  1. $ifcfg_fh->syswrite("IPADDR=$net.$self\nNETMASK=$netmask\nGATEWAY=$net.$gw\nDNS1=$net.$self\nDNS2=$net.$self\n");
    $ifcfg_fh->syswrite("IPADDR=$net.$self\nNETMASK=$netmask\nGATEWAY=$net.$gw\nDNS1=$dns1\nDNS2=$dns2\n");

Again, how you choose which one to use, I have not figured out. But without this change, if you restart the network, the DNS1 and DNS2 contents are used to overwrite /etc/resolv.conf to the wrong values...

This was not obvious from looking at hdactl. I had to deduce it based on system behaviour.

#3 Updated by bigfoot65 about 8 years ago

  • Priority changed from High to Medium

Also available in: Atom