Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I work at a big company with its own domain, and I SSH into servers every day, many times a day. Is it possible to simply type hostname instead of and still SSH successfully?

share|improve this question
up vote 3 down vote accepted

You can configure a search domain for DNS. (Not specifically for puTTY, but for all programs doing a DNS lookup).

How you do that depends on your OS.

For most unix like environments:

Open /etc/resolv.conf and a a search mydomain.tld.
You can add multiple search domains.

For windows

  • For windows: Go to control panel,
  • Network and sharing center,
  • select your LAN connection, then [Properties]
  • Select TCP/IP v4, then [properties
  • Go to [advanced]
  • tab "DNS". Add the search domain.

enter image description here

For any OS configured to use DHCP

Any big company should be using a DHCP server. That can supply not just IP leases, but also DNS server names and which paths to search. This assumes you have control over these. If not, ask IT to add your own domain.

Whenever you now try to resolve a hostname the resolver will not only try to resolve the hostname, but also This will work for anything which uses DNS (e.g. puTTY, Firefox, ...)

Hopefully needless to say, but replace 'my.domain.tld' with your actual domain name.

share|improve this answer

Just adding an entry to your hosts file should be sufficient. You'll need to know the IP address of the remote server -- you can find that out by running a ping on the full hostname.

  1. Log into your Windows computer as an administrator.
  2. Open up Notepad with administrative privileges. On Vista and later, it should be sufficient to click Start, type notepad, and hit Ctrl-Shift-Enter, or right-click the Notepad icon and select Run as administrator.
  3. With your administrator Notepad, find the file C:\Windows\System32\Drivers\etc\hosts.
  4. To the end of this file, add a line with an entry like the following: hostname where the IP and hostname are replaced with those of the server you want to connect to.
  5. Save and close. It should work immediately.

You can also set your DNS search path to include (which your IT administrator should arguably have done) -- bring up the properties for your network adapter by whatever means are appropriate for your version of Windows, then bring up the properties for the "Internet Protocol (TCP/IP)" entry, then Advanced, then on the DNS tab enter "" under "Append these DNS suffixes".

share|improve this answer
What if company changes its IP frequently... There's a reason why company didn't share IP directly. – Evil Angel Mar 25 '13 at 15:40
Then that's what the second half of the answer is for (as unlikely as it is that the poster's company is changing the IPs of servers at all frequently...) – tgies Mar 25 '13 at 15:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.