Jump to content

Search Suffix on LInux


rev.dennis
 Share

Recommended Posts

Many many people/apps still rely on short names (hostname1) instead of the FQDN (hostname1.thezah.com)

Obviously DNS doesn't know what to do with hostname1 so on LInux it will look in either one of two places for a search suffix (what to append to the end of that shortname)

/etc/resolv.conf

# internal dns servers
nameserver 1.2.3.4
nameserver 4.3.2.1
search thezah.com sub.thezah.com eventguyz.com sub.eventguyz.com

OR it can be done on the interface level at /etc/network/interfaces since /etc/resolv.conf gets overridden

auto eth0
iface eth0 inet static
    address 10.11.12.50
    netmask 255.255.255.0
    gateway 10.11.12.1
    dns-nameservers 1.2.3.4 4.3.2.1
    dns-search thezah.com sub.thezah.com eventguyz.com sub.eventguyz.com

So now when you query hostname1 it will then try hostname1.thezah.com, then hostname1.sub.thezah.com  (Always start with a more current domain on the left and work towards older, not so common domains it could be in at the right)

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...