Debian/Ubuntu:
dpkg -S filename
i.e.:
# dpkg -S /etc/gimp/2.0/controllerrc
c
gimp-data: /etc/gimp/2.0/controllerr
to achieve the same thing in RedHat/CentOS distros:
rpm -qf filename
i.e.:
# rpm -qf /etc/httpd/
httpd-2.4.6-40.el7.centos.x86_64