I have the below entries in my /etc/resolv.conf

# more /etc/resolv.conf
domain c.XXXX-XXXX-XXXX.internal
search c.XXXX-XXXX-XXXX.internal. XXXX.internal.
nameserver XX.XX.XX.XX

How can I add new entry to search? Like below

# more /etc/resolv.conf
domain c.XXXX-XXXX-XXXX.internal
search c.XXXX-XXXX-XXXX.internal. XXXX.internal. XXXX.service.
nameserver XX.XX.XX.XX

I tried the below workaround, Installed,

sudo apt-get install resolvconf

and then edited,

sudo gedit /etc/resolvconf/resolv.conf.d/base

However, this will will update resolv.conf as below

# more /etc/resolv.conf
search XXXX.service.
domain c.XXXX-XXXX-XXXX.internal
search c.XXXX-XXXX-XXXX.internal. XXXX.internal.
nameserver XX.XX.XX.XX

I wanted search to be update in single line.

OS: Details
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.5 LTS"
New contributor
Sunil Gajula is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    This is substantially different for newer systems. You should probably specify your specific system in the question, is it really 12.04. Upgrade! – pbhj Dec 6 at 17:18

Your Answer

Sunil Gajula is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.