Help with multiple DNS setup

Discussion in 'macOS' started by mason.kramer, Sep 4, 2007.

  1. mason.kramer macrumors 6502

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #1
    I am trying to setup an internal web development server (LAMP + DNS) for a multiuser office. The LAMP server is running about 15 virtual hosts right now on the domain dg.krm i.e. mkramer.dg.krm. The idea is to maintain the hosts file on the LAMP server (dg, short for dark-genius) and have the clients use dg.krm as a dns server for any url in the dg.krm domain, and use a different nameserver for top level domains.

    I've configured all the *nix clients to do this now with this configuration:
    Code:
    ###/etc/resolv.conf
    search dg.krm krm
    nameserver ***.***.***.***  ##my isp's nameservers
    nameserver ***.***.***.***
    
    ###/etc/resolver/dg.krm
    nameserver 192.168.123.100  ##this is the ip of dark-genius
    
    This works great if I type in QDN's. I.E. mkramer.dg.krm resolves using dg.krm's DNS server and google.com resolves using my ISP-provided DNS.

    However, the search domains are not working quite right. If I try "mkramer", something unexpected happens. I thought that it would append .dg.krm to the search and take me to mkramer.dg.krm. Instead, it takes me to the page which is being served at dg.krm. This is true for any virtual host that I try. I wonder if someone could explain this behavior to me and is there any way to make it work?
     
  2. mason.kramer thread starter macrumors 6502

    mason.kramer

    Joined:
    Apr 16, 2007
    Location:
    Watertown, MA
    #2
    I figured it out. The resolver agent was correctly appending .dg.krm to the hostname and then looking it up on dg.krm's server and resolving it to dark-genius's ip address. The problem is that the http Host: header was not being similarly appended. This lead to a situation where apache was receiving a request but not for a valid host, so it was returning the default virtual host. To fix this I had to configure each virtualhost with the short name of the virtual host like this:
    ServerAlias mkramer
     

Share This Page