Jump to content
  • Announcements

    • dennis

      Welcome to theZAh   06/09/2016

      Enjoy the site and let us know if you find anything not appropriate... silly spammers.
dennis

Search Suffix on LInux

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)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×