Skip navigation

Setting individual IP addresses for Web testing

1076 Views 21 Replies Latest reply: Nov 4, 2012 10:47 PM by Claude Cauwe RSS
1 2 Previous Next
Claude Cauwe Level 2 Level 2 (210 points)
Currently Being Moderated
Oct 30, 2012 5:00 AM

Dear all,

 

I recently purchased an old MacMini to do some Web-application testing in a more convenient way than using a remote server.

Because the MacMini is a rather old model (first Core 2 Duo model), I installed MacOS 10.6.6 SnowLeopard Server on it.

 

I am, however, facing troubles to get it do what I wish.

 

The IP address of the machine is : 192.168.1.42

 

I wish it to respond to the following addresses :

 

192.168.1.100 for website svenskaklubben.be

192.168.1.101 for website schumantrophy.eu

192.168.1.102 for website sky-project.com

 

Etc ...

 

These sites do not have to be accessible from the outside : they are LAN only for testing.

 

The default configuration with only one site works perfectly, but things do change when I add several websites.

 

When I setup the zones in the DNS part of the server, the best result I can achieve is that a trace (or ping) on the name returns the IP correctly.

But when I ping (or trace) the IP, it always says : "host not found", or "host down"

 

Most probably, I do mess up somewhere.

Any help to guide me step-by-step would be highly appreciated, since I'm working on this since a couple of days and start to loose my nerves :-)

 

Lots of thanks in advance

iMac 24, Mac OS X (10.7.2), SpeedTouch Router, 802.11g, Nikon D80, PBG4 1.33 and iPad 3G/32
  • MrHoffman Level 6 Level 6 (11,695 points)
    Currently Being Moderated
    Oct 30, 2012 5:48 AM (in response to Claude Cauwe)

    Have you discounted virtual hosting ("sites") for a particular reason; do you actually need to use distinct IP addresses here?

     

    It'd be easier to configure a virtual host ("site") for each of these three domains, and share the same IP address.  That would mean an A (machine) record for the actual host name for the Mac Mini Server (whatever you're really calling the system), and three (or more) CNAME (alias) entries for the domains you want to test with.

  • MrHoffman Level 6 Level 6 (11,695 points)
    Currently Being Moderated
    Oct 30, 2012 5:09 PM (in response to Claude Cauwe)

    If this is a newly-installed system, wipe your disk and reinstall and keep clear of the configuration files; stay clear of modifications to those until you gain some experience with OS X Server, as modifications there can lead to instabilities or problems with the management tools.  Use the Server Admin tool to manage the virtual hosts; what Apple refers to as "Sites" in Server Admin tool.

     

    Do you mean that Virtual Hosting uses the same IP of the server (192.168.1.42) ?

     

    Yes.  The web server host can be and often is a virtual construct, and not a one-host one-server or one-host one-IP setup.   IPv4 addresses - and particularly public IPv4 addresses - can be fairly dear resources, so using fewer of these addresses is quite popular, and a number of network services can therefore be virtualized.

     

    I thought, after a look in the Apache config files, that those "sites" needed each a different IP - hence my question.

     

    The user enters the target domain name or IP address into the URL bar of the web browser client.  The web client asks its DNS server for the IP address, if a DNS domain name is entered.  This IP address is then used for IP routing.   The web clients will (also) pass a text string containing the target web server and file specification in the HTTP (or HTTPS) web traffic; the target name is passed from the client to the web server.  This string is then parsed and can be used by the web server to select which web site (virtual host) to present to the client.   While IP addresses can be relevant here if that's the particular target string that the user has entered into the URL address in the browser (and thus what gets passed over to the server), IP addresses are usually otherwise only used for network packet routing and don't get involved in the higher-level HTTP/HTTPS traffic and the web presentation.  IP routing is entirely happy to operate with zero or one or a thousand web sites with the same IP address, after all.  It's the HTTP/HTTPS connection between the web client and the web server that selects the virtual host ("site") that the web server displays.

     

    If you're unfamiliar with HTTP, and on how DNS and HTTP (and HTTPS) and virtual hosts ("sites") interact, then here is a very quick intro.

     

    But your answer raises another question from my side, then : how can I be sure, when I do test a site using the CNAME alias is pointing to my development version on the LAN? and not to the the existing official site on the Web ?

     

    Because your LAN DNS server is configured and refers to your domains and your host, and to your local IP addresses?   That would be typical, after all, when you want to have a second and separate server mimicking (or spoofing) the "real" server.  If your web client hits your DNS server, then your DNS server returns your local IP addresses, you're encapsulated on your LAN.  You won't ever reach the "real" servers with these particular domain names; with what you've configured in your local DNS services database.  If you're unfamiliar with setting up OS X Server DNS services on your local network, then here is a detailed OS X Server DNS server set-up article.

  • MrHoffman Level 6 Level 6 (11,695 points)
    Currently Being Moderated
    Oct 31, 2012 5:29 AM (in response to Claude Cauwe)

    This is likely an error: 192.168.1.30.example.com.

     

    That's not what I would expect the NS nameserver name to be.

     

    This is an error for what should be resolved from local DNS: a.root-servers.net. nstld.verisign-grs.com.

     

    That's not your DNS server that's being referenced; that's leaking out to the Internet.

     

    Don't bother testing with the virtual hosts settings until DNS is working.

     

    Check your DNS server name in DNS, as it looks incorrect in one or more of your zones, and (because it's a common source of errors) the DNS server specification in DHCP.  There appear to be two separate errors here.

     

    Use of the 192.168.1.0/24 subnet (and the 192.168.0.0.24 subnet, for that matter) can cause issues for VPN routing, if/when you decide to start utilizing that capability.

  • MrHoffman Level 6 Level 6 (11,695 points)

    Your LAN-local clients will want to reference your DNS server (and only your DNS server), either manually with Network Preferences configuration, or via your DHCP Server settings.

     

    I show and generally use the dig and dig -x commands for testing DNS servers, and generally not the nslookup stuff.

     

    If you want to look at the DNS cache contents with OS X or OS X Server, see the dscacheutil command.  Here is a quick example of dscacheutil; of forward- and reverse-DNS translations using the local DNS caches.

     

    I'd recommend getting a real and registered domain, and not using a made-up domain, too.  The more stuff you have and the longer you run with a made-up domain, the bigger the pain factor if (when?) you should want (need?) to go public with some of your local network host names; spending $5 to $15 a year on a real and registered domain or two starts to look cheap in comparison with migrating.

  • Camelot Level 8 Level 8 (45,670 points)

    It seems to me you're looking at this from the wrong direction.

     

    Your original post seems to indicate that DNS is, indeed, working properly:

     

    traceroute to schuman-trophy.example.com (192.168.1.100), 64 hops max, 72 byte packets


    This tells me you tried to traceroute to shhuman-trophy.example.com and that the OS looked up the address of this host and got back a reply of 192.168.1.100

     

    That means your DNS is working.


    What's missing is whether you've configured that IP address on your server. Nowhere in your post do you say you've done that. The fact that your ping and traceroute fail indicate to me (at least if you're trying this on the LAN), that there is no machine on your network with that IP address.

     

    So my question is - did you actually configure these IP addresses on your server? or does it still only have the .42 address?

    Just adding a machine to DNS doesn't do anything about it actually existing anywhere. You still need to configure a machine with that address for the rest of the equation to work.

  • Camelot Level 8 Level 8 (45,670 points)

    It's kind of hard to get a clear picture of where you are, but I *think* you're at the state where you have a functional machine (192.168.1.42) that all the clients on the network can access (at least ping and traceroute to).

     

    Your recent post, though, shows varying instances where you can sometimes nslookup the name of the server to resolve it's IP, and sometimes you can't. Are those from various machines on the network? or from the same machine?

     

    If they're from different machines then the first problem is that each machine is using 127.0.0.1 (localhost) for name resolution. That is only valid if every machine is running as a DNS server. That's OK to do... unusual, at the very least, but valid, but then you have to determine whether you want to maintain individual zone files on each machine (a PITA), or whether one machine should be the master, from which all the other machines refer to.

     

    You could, of course, setup your network in a more typical manner and just have one (or two) servers on your LAN running as DNS server, and pointing each client to use those for all DNS lookups. This simplifies your DNS setup, where you need to make changes, and the number of potential points of failure.

     

    So I suggest step one at this point is to answer my questions on DNS - how it's running now, and how you want to run it moving forwards.

1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.