Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a home web server (mac mini) running MAMP. I've setup a couple web apps that I want to offer to my friends when they come over. I can access the websites when using a browser on the webserver because the hosts file knows that the url ties to a virtual host.

I'm trying to figure out a solution that would let other people on my network access the webapps. Right now my solution requires my friends to edit their Hosts file, which is a pain. Is there an easier way?

share|improve this question

migrated from serverfault.com Aug 17 '09 at 6:29

This question came from our site for professional system and network administrators.

6 Answers 6

You need a DNS server on your network that will resolve these host names to IP's, You may be able to get your router to do this for you, or need a separate server.

You will also need your guests to use this DNS server as their preffered DNS server, if your using DHCP to give out IP addresses on your network then this is relatively easy.

share|improve this answer

if they are on the same lan you can:

  • tell them to use ip address of your box

or

  • register public dns entry pointing to private ip of your server

you can as well get public ip for your server [ or redirect some port from public ip ] and make it internet-reachable [ but do keep in mind to secure it before ].

share|improve this answer
1  
If Apache is using virtual hosts then using the IP address is not going to work properly. –  Sam Aug 16 '09 at 21:09
    
indeed, although - if it's home intranet using /something will do the trick as well. –  pQd Aug 16 '09 at 21:15

Another solution (similar, but a little different to one already posted) is to get a Dynamic DNS Name (from a provider like dyndns.org) and on your router, forward port 80 to the IP address of your intranet server.

Then by accessing the URL you choose with dyndns (e.g. myhomeintranet.dyndns.org), the DNS will resolve to your router, and be forwarded to your web server automatically.

Same rule goes though - you have to make it fairly secure if you're going to be doing this as it does open your network up to the outside world.

share|improve this answer

If you're talking about just within your own network, you either assign your server a static IP and have people browse to that address (for example, http://192.168.254.50) or you set up a DNS server inside your network that assigns a name (like "webserver") to the web server's static IP address (192.168.254.50), of course replacing values with what you want to use.

You'd also need to change your DHCP server so that it hands out the proper DNS server instead of itself, if you're currently using a SOHO router or something from your provider that acts as the DHCP server now.

share|improve this answer

First of all you need some sort of dns on your internal network and the dhcp server needs to tell connecting hosts to use that dns server. Some SOHO firewall dhcp servers can do this others have problems. dnsmask can handle both chores and is built into some SOHO firewalls.

If your firewall doesn't allow configuring which dns server is advertised via DHCP you may want to install some solution on some machine on your network and turn those services on the firewall. It will add some more complexity but it may be your only solution.

You will need a dns server and a dhcp server. If you are running a MS server (Not MS home server) on the network as well it may be able to handle both DNS and DHCP services for you depending on the licensing restrictions. ISC's BIND and DHCP server are the standard but are likely overkill for smaller installations. dsnmashq handles both dhcp and dns for you. There are quite a few other DNS implementation, tinydns being another.

share|improve this answer

This question is answered very well already by others - and

If they are using windows... install samba & use its name service. it is much easier to configure[1]. Plus you don't have to change any setting for them to "discover" the machine[2].

[1] DNS servers, in the past, are not for anybody who can't read manpages & documentations, though of course this has been improved much nowadays...

[2] if you are already distributing the IP from a DHCP-enabled router, of course you won't need to change that, but you'd have to setup a DNS server on the router/somewhere else which may or may not be a very easy job...

share|improve this answer

Your Answer

 
discard

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