LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2005, 01:10 AM   #1
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Rep: Reputation: 30
make wildcard subdomains on localhost work


is there anyway to make wildcards work for subdomains on localhost (or any other thing, i just want it to point to me), what i mean is is make anything.localhost go to 127.0.0.1 but not have to put anything.localhost into any specific file, i want to just put *.localhost into a file so that anything.localhost, something.localhost, blah.localhost all point to 127.0.0.1, i have tried putting *.localhost in my /etc/hosts file but it didn't work, and the only thing i found so far is setting up bind but i feel that would be overkill

so is there any way to do this without setting up bind?
 
Old 09-03-2005, 02:17 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
BIND is needed. Just open localhost system and add
*.localhost IN A 127.0.0.1

and restart bind.
 
Old 09-03-2005, 03:33 AM   #3
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Original Poster
Rep: Reputation: 30
ok, well now the reason i didn't want to use BIND, i cant figure out the config files , i need help setting it up

i also tried adding "nameserver 127.0.0.1" (at the top) to my /etc/resolv.conf but that didnt seem to help

my /etc/named.conf is

Code:
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
};

//
// a caching only nameserver config
//
zone "." IN {
        type hint;
        file "caching-example/named.ca";
};

zone "localhost" IN {
        type master;
        file "caching-example/localhost.zone";
        allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "caching-example/named.local";
        allow-update { none; };
};
my /var/named/caching-example/localhost.zone (i thought it went at the end of this file) is

Code:
$TTL    86400
$ORIGIN localhost.
@                       1D IN SOA       @ root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

                        1D IN NS        @
                        1D IN A         127.0.0.1
 
Old 09-03-2005, 05:41 AM   #4
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
add line:

*.localhost IN A 127.0.0.1

To file /var/named/caching-example/localhost.zone

And restart bind and test it with nslookup/dig
 
Old 09-03-2005, 07:51 AM   #5
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
You can also use Webmin to manage bind. It is a simple web based management tool that can be used to do a lot of configuration on a *nix system. Its beauty is that it is exactly the same to perform any task on any flavor of *nix.

You can manage your DNS, play with a Samba config, manage a MySQL database, and much much more!

There is a Java shell environment you can get to from webmin. There is also an interesting file browser available.

One thing I liked was making changes with Webmin and then checking the config file itself to see what changes it made. This was the way I learned to manage my DNS entries. Now I do it all from the command line.

Note, you need a trailing . after localhost:

*.localhost. IN A 127.0.0.1

Hope this helps!

MrKnisely
 
Old 09-03-2005, 01:41 PM   #6
edman007
Member
 
Registered: Sep 2003
Distribution: slackware-current
Posts: 173

Original Poster
Rep: Reputation: 30
working now, thanks guys
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
localhost login wont work..HELP!!! GeneticDrift Linux - Newbie 8 03-14-2004 08:58 PM
how do i make subdomains on my webpage matt_w_lambert Linux - General 2 10-29-2003 11:51 PM
localhost does not work jjay02 Linux - Distributions 2 02-27-2003 08:09 AM
how to make use of the "*" wildcard in perl linuxlah Programming 3 12-04-2002 01:11 AM
http://localhost does not work! Rajasekhar Atte Linux - Networking 1 12-17-2001 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration