Stuck with, resolvconf error /etc/resolv.conf must be a symlink? We can help you.
Recently we had a customer who came across this error while trying to restart the BIND 9 server under Ubuntu Linux using service bind9 restart or service bind9 start command.
As part of our Server Management Services, we assist our customers with several Linux queries.
Today, let us see how to resolve this error.
resolvconf error /etc/resolv.conf must be a symlink
Generally, we use resolvconf to manage nameserver information. It comprises a simple database for run-time nameserver information and a simple framework for notifying applications of changes in that information.
Resolvconf acts as the intermediary between programs that supply nameserver information and applications that use that information.
We can add to or remove information from the database using the resolvconf program.
The resolvconf -u command only updates resolv.conf from resolvconf’s own database. The database should be updated. For that, we have to call resolvconf with the -a or -d option.
Usually, this error occurs when we try to restart the BIND 9 server under Ubuntu Linux.
# service bind9 restart
OR
# service bind9 start
resolvconf: Error: /etc/resolv.conf must be a symlink
How to solve the error?
In order to fix this error let us see possible methods suggested by our Support Techs.
One method is to log in as root and perform the following commands:
$ sudo -i
# cd /etc
# rm resolv.conf
# ln -s /etc/resolvconf/run/resolv.conf .
# service bind9 restart
- Postfix Error
We might also come across a postfix error along with the above error:
* Stopping domain name service… bind9 [ OK ] * Starting domain name service… bind9 /usr/sbin/postconf: fatal: open /etc/postfix/main.cf: No such file or directory cp: `/etc/resolv.conf’ and `/etc/resolv.conf’ are the same file run-parts: /etc/resolvconf/update-libc.d/postfix exited with return code 1 run-parts: /etc/resolvconf/update.d/libc exited with return code 1
In such a case, run the below commands:
$ sudo -i
# cd /etc
# mkdir postfix
# touch postfix/main.cf
# rm resolv.conf
# ln -s /etc/resolvconf/run/resolv.conf .
# service bind9 restart
As of Ubuntu 12.04, resolvconf is part of the base system. To recreate the symlink we need, we run:
dpkg-reconfigure resolvconf
or by doing the following in a terminal.
sudo ln -nsf ../run/resolvconf/resolv.conf /etc/resolv.conf
In Ubuntu 12.10, resolvconf no longer aborts if /etc/resolv.conf is not a symlink. Instead, it prints a warning that can be silenced by adding the line:
REPORT_ABSENT_SYMLINK=no
in /etc/default/resolvconf.
[Couldn’t resolve the error? We’d be happy to assist]
Conclusion
In short, the error, resolvconf error /etc/resolv.conf must be a symlink occur when we try to restart the BIND 9 server under Ubuntu Linux.
0 Comments