Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-25-2015, 09:08 AM   #1
LQ Newbie
Registered: Feb 2015
Location: Columbus,ohio
Distribution: Redhat, cents,zlinux
Posts: 2

Rep: Reputation: Disabled
Domain variable in resolv.conf

How many domain names can we give thie domain variable? Just one?
Old 02-25-2015, 09:16 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,711

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
Just one. There can be only one local domain... From the manpage on resolv.conf:
domain Local domain name.
              Most queries for names within this domain can  use  short  names
              relative to the local domain.  If set to '.', the root domain is
              considered.  If no domain entry is present, the domain is deter‐
              mined  from  the  local hostname returned by gethostname(2); the
              domain part is taken to  be  everything  after  the  first  '.'.
              Finally,  if  the  hostname  does not contain a domain part, the
              root domain is assumed.
It is there so you can use a short name, and have it expanded to the FQDN for lookups. Thus if there were two "local domains" you could have the same name used for two different systems - and not be able to identify which one is being referred to.

Now if you want to search multiple domains, then use the "search" instead. You can put up to six domains. Note that the name lookup is done sequentially - so this can slow down response. From the manpage:

search Search list for host-name lookup.
              The search list is normally determined  from  the  local  domain
              name;  by default, it contains only the local domain name.  This
              may be changed by listing the desired domain search path follow‐
              ing the search keyword with spaces or tabs separating the names.
              Resolver queries having fewer than ndots dots (default is 1)  in
              them  will  be attempted using each component of the search path
              in turn until a match is found.  For environments with  multiple
              subdomains  please  read  options ndots:n below to avoid man-in-
              the-middle attacks and unnecessary  traffic  for  the  root-dns-
              servers.  Note that this process may be slow and will generate a
              lot of network traffic if the servers for the listed domains are
              not local, and that queries will time out if no server is avail‐
              able for one of the domains.

              The search list is currently limited to six domains with a total
              of 256 characters.
1 members found this post helpful.
Old 02-25-2015, 09:47 AM   #3
LQ Newbie
Registered: Feb 2015
Location: Columbus,ohio
Distribution: Redhat, cents,zlinux
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thumbs up



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Centos 6.5: search domain not added to /etc/resolv.conf (IPv6 DNS server) JohanHarmsen Linux - Newbie 4 08-27-2014 10:20 AM
DNS - resolv.conf with custom tld (top level domain) domain directive rubanek Linux - Networking 1 06-04-2013 01:11 PM
understanding "domain" option in /etc/resolv.conf m4rtin Linux - Networking 6 09-25-2012 11:27 AM
resolv.conf autophil Linux - Networking 3 08-15-2007 09:51 AM
DNS Hosts.conf or resolv.conf problem mac_casey SUSE / openSUSE 0 03-26-2006 10:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration