Accidently I corrupted my nsswithch.conf file and now my hosts are not working. How can I restore or recreate it?
Asked
Active
Viewed 8,066 times
1 Answers
3
This file is relatively generic, I would copy it from a working system of the same Ubuntu release
This should at least get you going - it's the default from xenial and should work regardless on pretty much any version.
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
gshadow: files
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
Trent Lloyd
- 384
- 1
- 8
grep nsswitch.conf /var/lib/dpkg/info/*.postinstleads to/var/lib/dpkg/info/base-files.postinstand/var/lib/dpkg/info/libc-bin.postinst, which lead to/usr/share/libc-bin/nsswitch.confand/usr/share/base-files/nsswitch.conf. Thelibc-binpost-installation script is more specific, so I'd use that. – muru Mar 23 '17 at 05:52libnss-mdnspostinst I think – steeldriver Mar 23 '17 at 10:40/etc/nsswitch.conf. Indeed,dpkg -S /etc/nsswitch.confdoes not return any results (on Artful). – Bram Geron Nov 01 '17 at 16:34