Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The openSUSE server name is 'darkhelmet'. I want to create an alias 'dh' for it. So I can also type 'ssh dh' and 'http://dh' would work too.

What file/files and where do I have to edit to make this happen?

Extract from /etc/hosts from darkhelmet

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
127.0.0.2       darkhelmet.edumate darkhelmet
10.0.0.22       db2workgroup db2workgroup

[root][skroob] nslookup darkhelmet

Server:     10.0.0.10
Address:    10.0.0.10#53

Name:   darkhelmet.edumate
Address: 10.0.0.22
share|improve this question
    
What is your local DNS setup? –  Andrew Jun 29 '12 at 0:32
    
I have no idea. How can I find out? –  Radek Jun 29 '12 at 0:33
    
Your nslookup output shows it as 10.0.0.10 - see the answer below. –  Andrew Jun 29 '12 at 1:13

1 Answer 1

up vote 4 down vote accepted

Your nslookup would indicate that 10.0.0.10 provides a DNS server. Do you have access to it? If not, then unfortunately you're out of luck.

Since you don't have access to the server, you'll need to ask the admin to add this entry to the zone file (or one to this effect):

dh.edumate.    IN CNAME darkhelmet.edumate.

Assuming that you (all) have search edumate in your /etc/resolve.conf.


I'm going to leave this previous answer for reference, otherwise this entire process won't make too much sense to others:

I am assuming you have at least 2 machines.

  1. darkhelmet
  2. All the other other ones that need to connect to darkhelmet

In this case, you need to edit /etc/hosts on the machines that you want to connect to darkhelmet on (but you can also do this on darkhelmet if you want it to be able to connect back to itself as dh).

e.g.

 1.1.1.1    dh

where 1.1.1.1 represents the IP that darkhelmet has. That way ssh dh and http://dh/ will work as expected.

share|improve this answer
    
Would this change be picked up automatically or do I have to do/restart something? –  Radek Jun 29 '12 at 0:20
    
It would depend on the tool, most of the time it's picked up automatically and instantly. Try ping dh at a terminal and see if it resolves to the IP or not. –  Jay Jun 29 '12 at 0:21
    
I added dh to this like 127.0.0.2 darkhelmet.edumate darkhelmet. ping dh from dh works but not from other server on the network. ping darkhelmet from the same server works. –  Radek Jun 29 '12 at 0:24
    
oh. I got it now. Is there any way I can do that at one place? Like name server or something like that? –  Radek Jun 29 '12 at 0:25
1  
For that, you'll need to tell us more about your setup. If you can tell us how all the other servers can already resolve darkhelmet to an IP, it should be the same method to alias it to dh –  Jay Jun 29 '12 at 0:28

Your Answer

 
discard

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.