I have the following code in a web.config file of the default IIS site.
According to Microsoft, other websites do not inherit settings from the Default Website. Do you mean you are editing the default web.config which is located in the same folder as the machine.config?