resolv.conf search syntax

Issues related to configuring your network
Post Reply
amedix
Posts: 27
Joined: 2015/10/30 05:58:13

resolv.conf search syntax

Post by amedix » 2018/10/31 13:34:38

Hi,

Is this format of the file "/etc/resolv.conf" correct ?

search domain1.com
search domain2.com
nameserver server1


Or it should absolutely have this format instead ?

search domain1.com domain2.com
nameserver server1



Thanks

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: resolv.conf search syntax

Post by stevemowbray » 2018/10/31 13:50:04

man resolv.conf

amedix
Posts: 27
Joined: 2015/10/30 05:58:13

Re: resolv.conf search syntax

Post by amedix » 2018/10/31 14:00:37

Already looked at it, but it doesn't say if the following format is correct or not :

search domain1.com
search domain2.com
nameserver server1

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: resolv.conf search syntax

Post by jlehtone » 2018/10/31 15:13:00

Doesn't?
The domain and search keywords are mutually exclusive. If more than one instance of these keywords is present, the last instance wins.
Nevertheless, the syntax question should be moot.
Either NetworkManager.service or network.service should write that file for you (in proper syntax).
The real question should thus be: How to feed desirable data to those services?
(For 99.99% of cases the answer to latter ought to be: DHCP server of the subnet does the Right Thing.)

amedix
Posts: 27
Joined: 2015/10/30 05:58:13

Re: resolv.conf search syntax

Post by amedix » 2018/11/01 07:04:28

Thanks for your help, now it's clear.

The man that I've looked at doesn't mention it.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: resolv.conf search syntax

Post by jlehtone » 2018/11/01 09:22:12

Which man is that?

amedix
Posts: 27
Joined: 2015/10/30 05:58:13

Re: resolv.conf search syntax

Post by amedix » 2018/11/01 11:58:34

Some that I've found on the net, probably old ones

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: resolv.conf search syntax

Post by TrevorH » 2018/11/01 15:27:02

How about running it on your CentOS system instead and reading the pages that we supply that should be in sync with the packages we supply too.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: resolv.conf search syntax

Post by hunter86_bg » 2018/11/06 05:07:59

Just use the

Code: Select all

search domain1.com domain2.com domain3.com

Post Reply