Bug 152036

Summary: Adding servername to /etc/hosts
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Forgotten User --EoyBps8f <forgotten_--EoyBps8f>
Component: YaST2Assignee: Katarina Machalkova <kmachalkova>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: postadal, richard.bos, suse-beta
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Forgotten User --EoyBps8f 2006-02-18 11:28:32 UTC
Hello!

I set up my http-server using the Yast-module to respond to two "domains", e.g. server1 and server 2. I pointed them to their directories in /srv.

However, in order for those servernames not be be resolved by DNS, but handled locally, I had to add them to the /etc/hosts file.

Would it make sense to add them automatically when setting them up in Yast? That way, even somebody who does not know about /etc/hosts can set up a local domain for each project.
Comment 1 Michael Gross 2006-02-20 12:40:01 UTC
No I don't think this would make sense... it would rather spoil the DNS system.
Maby it would make sense adding an option like (set up /etc/hosts for local usage) or something of that sort with an explaining help text.

There is a dialoge to edit the hosts file, though. Maby it would be sufficient to add some hint here.
Comment 2 Cristian Rodríguez 2006-02-20 13:44:20 UTC
I think this is **not** a good idea, I think Documenting or adding some hint about the problem is the right way to go.
Comment 3 Petr Ostadal 2006-02-20 13:54:31 UTC
reassign to maintainer of yast2-network module 
Comment 4 Martin Vidner 2006-02-20 14:03:31 UTC
Hm, OK, yast2-network should provide other yast modules with an API for accessing /etc/hosts.
Comment 5 Forgotten User --EoyBps8f 2006-02-20 14:31:43 UTC
Indeed this could spoil DNS, if the hostname set up exists on the net too, yet I meant it for local web-development and in case the domain's files are on that server, so the aim is, to "spoil" DNS.

I am no pro in this matter, but why would somebody set up a local hostname with apache, if not to point it to a local directory, i.e. explicitly not wanting to use DNS for it? Of course, if I set up suse.com locally, I will not be able to access the genuine website, but if I do it for my domain on a server or my project on a desktop, I want exactly that, do I not?

If I am wrong, a hint is obiously the only choice, rather than spoiling DNS.

I tried the /etc/hosts module, yet it does not allow me to add several hosts for the same IP.

In order not to have to use localhost/web1, which spoils all links on that project beginning with a "/", I have

/srv/www/htdocs/web1
/srv/www/htdocs/web2

set up as sperate hosts with apache. Their names are web1 and web2. I added a line for each to the /etc/hosts manually. It works, i.e. I can enter web1 in konqueror and it does not try to resolve the name, but uses the local dir.

myIP web1.site web1
myIP web2.site web2

However, if I use the /etc/hosts module in yast, it only shows one of the lines. If I try to add another, it tells me that the IP already exists.

Is it not allowed to have several hosts for the same IP, or is this a bug?
Comment 6 Martin Vidner 2006-08-28 11:58:42 UTC
Reassigning to the new co-maintainer of yast2-network.
Comment 7 Martin Vidner 2006-08-28 12:01:04 UTC
second service...
Comment 8 Katarina Machalkova 2006-09-06 15:28:57 UTC
*** Bug 73543 has been marked as a duplicate of this bug. ***
Comment 10 Katarina Machalkova 2006-09-07 09:30:31 UTC
Reopening, since this is different issue than FaTE #2202 and bug #73543 (but will fix this anyway ;-) )
Sorry for the confusion
Comment 11 Katarina Machalkova 2006-09-19 15:05:42 UTC
You should now be able to add more FQDNs for one IP address in /etc/hosts editor (since yast2-network 2.13.65)
However, I didn't do tons of excessive testing, so should you face any problems, feel free to reopen. Autoyast support for this issue is still WIP, though