Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-29-2004, 09:00 PM   #1
LQ Newbie
Registered: Jun 2004
Location: Washington DC, US
Distribution: Debian, Kubuntu
Posts: 23

Rep: Reputation: 15
How to disable all subdomain on apache2?

Hello gurus,

I have apache2 running on my Debian Sarge box. I just got my domain name and was about to setup subdomains under it when I realized that ALL subdomains are currently active!! This is what I want to disable.

For example, say I have a website under The problem is that all these requests go to the same website:


How can I disable these subdomains? How can I disable ALL subdomains?
Old 08-01-2004, 03:44 AM   #2
Registered: Aug 2003
Location: Seattle, Wa
Distribution: Fedora,Trustix,Debian
Posts: 290

Rep: Reputation: 30
If every subdomain resolves to your ip address then The problem is not with apache but with your dns configuration at your domain provider. Its probably set to forward everything to your ip address just delete that mx record from you dns configuration or change it so that only www is set to be forwarded within that mx record.
Old 08-01-2004, 03:20 PM   #3
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
There are 2 systems working for http name resolution.. dns and url
(mx records are just for mail zatriz and won't apply to gepesz's http question)

dns tries to find a server that will match the url asked for, so you either delegate this to a dns provider, or do it yourself with your own dns server. Very few isps allow you to manage your subdomains remotely, but you can always ask them.. It's included in a commercial contract but not normally in a domestic contract.

If your isp by default resolves everything to your box, then apache has to filter it.
apache has virtual servers that match what you specify, and a default server that handles the rest.
If you want to stop the default page from being given for crazy http urls, make it a 404 ERROR page and only have valid virtual sites.

If you have your own dns server, you need to tell your isp to forward all requests to you so that you can manage all the subdomains yourself..

The difference between the 2 ideas is that with your own dns server, apache never gets a connection for a bad url, but the dns server does, which is less and faster traffic.
Old 08-01-2004, 04:52 PM   #4
Registered: Aug 2003
Location: Seattle, Wa
Distribution: Fedora,Trustix,Debian
Posts: 290

Rep: Reputation: 30
Sorry My mistake on the first post I meant A records not mx


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to create apache2 subdomain? gepesz Linux - Networking 3 09-20-2012 05:07 AM
how do i disable apache2 error banners? nazdrowie Linux - Security 2 01-19-2005 04:39 PM
how to uninstall apache2 which is installed by emerge apache2 flybirdlong Linux - Software 1 07-17-2004 11:46 AM
Subdomain help DoobyWho Linux - General 3 04-14-2003 06:51 PM
subdomain deepak Linux - Networking 2 03-01-2001 09:50 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:03 AM.

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