Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I was hoping to set my local host in my resolv.conf to hermes. So in affect if I type in hermes:8080 into the browser, I get the localhost:8080

How is this accomplished?

Please and thank you.

share|improve this question
    
From what I understand reading the answers, you need to replace 'localhosts' in '/etc/hosts' with 'hermes'. Good luck. –  Oxwivi Sep 7 '11 at 15:42

2 Answers 2

You need it in /etc/hosts, not /etc/resolv.conf.

And your host name should already appear in /etc/hosts.

What does it say when you run this from the terminal?

grep '127.0.1.1' /etc/hosts

What about:

cat /etc/hostname
share|improve this answer
    
what do I need to do to get the desired result. it says hermes. to answer your first question. hermes as well for your second question. –  myusuf3 Feb 20 '11 at 20:11

You can add it to /etc/hosts, like this:

127.0.0.1 hermes

(127.0.0.1 is the same as localhost)

share|improve this answer
1  
That's bad. If you replace the 127.0.0.1 entry, things will break. It should be added using a separate entry 127.0.1.1 hermes, but it should have already been added by NetworkManager, so there is another problem. –  Mikel Feb 20 '11 at 0:12
    
Adding it won't break anything, because it doesn't overwrite previous links to 127.0.1.1. –  Vallery Feb 20 '11 at 0:26
    
There is a difference between 127.0.0.1 and 127.0.1.1. You said 127.0.0.1, which should just be 127.0.0.1 localhost (or 127.0.0.1 localhost.localdomain localhost or similar). –  Mikel Feb 20 '11 at 0:30
    
If you add a second 127.0.0.1 entry, then some things will work, but reverse lookups (e.g. getent hosts 127.0.0.1) won't return your host name, which could break some things. –  Mikel Feb 20 '11 at 0:31
    
I've got multiple things going to 127.0.0.1 in my /etc/hosts: i.imgur.com/A2aCj.png –  Vallery Feb 20 '11 at 0:32

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.