Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Dynamic subdomains with /etc/hosts

  • 22-01-2008 4:05pm
    #1
    Registered Users, Registered Users 2 Posts: 304 ✭✭


    Hi all,

    For local development purposes I want to set up a fake domain on /etc/hosts, and preferably some subdomains.

    I.e. if I setup beaker.test in /etc/hosts to point to 127.0.0.1 I'd also like a way to have it automatically redirect phantom.beaker.test and muppet.beaker.test and www.beaker.test to my machine. In fact, I want every subdomain of beaker.test to point to 127.0.0.1

    Is this possible or do I have to do some funny things with a local dns server?

    I'm running ubuntu, and this is the relavent extract from nsswitch.conf:
    hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
    

    Thanks
    Aoife


Comments

  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    You can do it with the hosts file.


  • Registered Users, Registered Users 2 Posts: 304 ✭✭PhantomBeaker


    Ok, cool. The next trick is how.

    I've tried
    127.0.0.1 beaker.test
    and
    127.0.0.1 *.beaker.test

    If I try to go to notInHostFile.beaker.test I still don't connect to 127.0.0.1

    So I'm probably missing something painfully obvious, but I can't find it in hosts(5) and I can't quite find the right term for google.

    Thanks,
    Aoife


  • Registered Users, Registered Users 2 Posts: 16,288 ✭✭✭✭ntlbell


    sorry I missed the "dynamic" part my bad.

    With /etc/hosts you will have to add each subdomain you want as a separate entity within the hosts file.

    Sorry for the confusion.

    or you could setup bind.


Advertisement