Dns record problem

I suppose that you have set a wildcard virtualhost in your httpd.conf for your domain.

I should be wrong, but is what should let apache act this way.

Regards
 
I suppose that you have set a wildcard virtualhost in your httpd.conf for your domain.

I should be wrong, but is what should let apache act this way.

Regards

I checked mydomain's httpd.conf in directadmin but there is no wildcart for my domain. But I should report that users also accessing my site via;

myip
ns2.mydomain.com
 
It could be several ways, one is already mentioned by Andrea. The other might be that you have IP-based virtual hosts (by a chance). In this case you might need to re-configure apache, and check /etc/httpd/conf/ips.conf as well.

related: http://httpd.apache.org/docs/2.2/vhosts/name-based.html

this is my mydomain's httpd.conf and I think it is ip-based. But all of my other domains httpd.conf is similar to this. only one domain has a problem like this.

Code:
<VirtualHost 11.111.111.11:80 >


	ServerName www.mydomain.com
	ServerAlias www.mydomain.com mydomain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/myuser/domains/mydomain.com/public_html
	

	UseCanonicalName OFF

	<IfModule !mod_ruid2.c>
		SuexecUserGroup myuser myuser
	</IfModule>
	
	CustomLog /var/log/httpd/domains/mydomain.com.bytes bytes
	CustomLog /var/log/httpd/domains/mydomain.com.log combined
	ErrorLog /var/log/httpd/domains/mydomain.com.error.log


	<Directory /home/myuser/domains/mydomain.com/public_html>

		AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,Includes,IncludesNOEXEC,MultiViews,SymLinksIfOwnerMatch,FollowSymLinks,None
		Options -ExecCGI

		php_admin_flag safe_mode OFF

		php_admin_flag engine ON
		php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f [email protected]'

		php_admin_value open_basedir /home/myuser/:/tmp:/var/tmp:/usr/local/lib/php/

	</Directory>

</VirtualHost>
 
No need to post mydomain's httpd.conf, as it's useless. Previously I wrote about /etc/httpd/conf/ips.conf that's the file of an interest, as well as /etc/httpd/conf/extra/httpd-vhosts.conf





 
No need to post mydomain's httpd.conf, as it's useless. Previously I wrote about /etc/httpd/conf/ips.conf that's the file of an interest, as well as /etc/httpd/conf/extra/httpd-vhosts.conf

No need to post mydomain's httpd.conf, as it's useless. Previously I wrote about /etc/httpd/conf/ips.conf that's the file of an interest, as well as /etc/httpd/conf/extra/httpd-vhosts.conf

My /etc/httpd/conf/ips.conf

Code:
# Auto generated apache config file by DirectAdmin version 1.43.0
# Modifying this file is not recommended as any changes you make will be
# overwritten when you add/remove ip's through DirectAdmin.

LogFormat "%O \"%r\"" homedir
NameVirtualHost 11.111.111.18:80
NameVirtualHost 11.111.111.18:443
NameVirtualHost 11.111.111.19:80
NameVirtualHost 11.111.111.19:443
NameVirtualHost 11.111.111.20:80
NameVirtualHost 11.111.111.20:443
NameVirtualHost 11.111.111.21:80
NameVirtualHost 11.111.111.21:443
NameVirtualHost 11.111.111.22:80
NameVirtualHost 11.111.111.22:443
NameVirtualHost 11.111.111.23:80
NameVirtualHost 11.111.111.23:443
NameVirtualHost 11.111.111.24:80
NameVirtualHost 11.111.111.24:443
NameVirtualHost 11.111.111.25:80
NameVirtualHost 11.111.111.25:443
NameVirtualHost 11.111.111.26:80
NameVirtualHost 11.111.111.26:443
NameVirtualHost 11.111.111.27:80
NameVirtualHost 11.111.111.27:443
NameVirtualHost 11.111.111.28:80
NameVirtualHost 11.111.111.28:443
NameVirtualHost 11.111.111.29:80
NameVirtualHost 11.111.111.29:443
NameVirtualHost 11.111.111.30:80
NameVirtualHost 11.111.111.30:443

My /etc/httpd/conf/extra/httpd-vhosts.conf

Code:
Include /etc/httpd/conf/ips.conf

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 11.111.11.18:80>
    ServerAdmin webmaster@localhost
    AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
    DocumentRoot /var/www/html
    ServerName localhost
    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    CustomLog /var/log/httpd/homedir.log homedir
</VirtualHost>

<VirtualHost 11.111.11.18:443>
    ServerAdmin webmaster@localhost
    AliasMatch ^/~([^/]+)(/.*)* "/home/$1/public_html$2"
    DocumentRoot /var/www/html
    ServerName localhost
    ScriptAlias /cgi-bin/ /var/www/cgi-bin/
    CustomLog /var/log/httpd/homedir.log homedir

    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
</VirtualHost>
 
Your /etc/httpd/conf/ips.conf has no <VirtualHost...> sections for default virtual host. What is a status of every single IP from it? free? shared? owned?

What IP does the virtual host with the domain in question have from those?
 
Your /etc/httpd/conf/ips.conf has no <VirtualHost...> sections for default virtual host. What is a status of every single IP from it? free? shared? owned?

What IP does the virtual host with the domain in question have from those?

In the past my site runs on a vps server and now I've a dedicated server. The ip of the domain on the question is;

NameVirtualHost 11.111.111.19:80
NameVirtualHost 11.111.111.19:443

Status of my ip is owned. Also there is two subdomains under this ip.

The interesting think is that only this ip works with this way. There is no problem on the other ips.
For example there is an another domain on the other ip but when I try to enter with pop.mydomain2.com it says "Apache is functioning normally"
 
The interesting think is that only this ip works with this way.

That's the only IP with status owned. I'd guess. So that's the core.

If the IP is owned, then there is no <VirtualHost...> section for a default virtual host for that IP. Since it has no a default <VirtualHost...> section, with any host in a request you will see content of a virtulhost which is the first one with that IP. That's caused by a SSL requirements I'd guess. Just update DNS records for

pop.mydomain.com
smtp.mydomain.com
mail.mydomain.com

to point them to the server IP.
 
dns2.jpg my dns record
ipstatus2.jpg my ip status

What shoul I do now. How I will update my dns record?
 
My owned ip is 11.111.111.19
I understood that I will change ip records of pop, mail and smtp from dns management.
I will make their A records to 11.111.111.18 is it true?
After do that I'will restart httpd service. So when will it active? Is there any dns cache on user's computer about this?

Also some of these url (pop.mydomain.com, mail.mydomain.com) have had indexed by google bots. What do you think about them?
If a user come from a url which start with pop, how can I redirect him to my real url which start with www?
 
My owned ip is 11.111.111.19
I understood that I will change ip records of pop, mail and smtp from dns management.
I will make their A records to 11.111.111.18 is it true?
If that's the server IP#, then yes.
After do that I'will restart httpd service. So when will it active? Is there any dns cache on user's computer about this?
Yes, there's a cache; it could take anywhere from a few minutes to a day or more, depending on the TTL setting in each record of your zone file. But only for people who've already visited your site with the undesired fqd, since the cache is at a local level.
Also some of these url (pop.mydomain.com, mail.mydomain.com) have had indexed by google bots. What do you think about them?
If a user come from a url which start with pop, how can I redirect him to my real url which start with www?
I've never tried this, but perhaps you can set up an redirect in a /var/www/html/.htaccess file (create it if you don't have it). This may cause undesirable side effects, so try it.

Jeff
 
Why directadmin add ftp, mail and smtp as an A record?

Hi everybody;

When I added new domain, directadmin creates ftp, smtp and mail A records beside www. Why directadmin do that? I ask it because it can be a problem sometimes. For example;

I use an "owned ip" for a user. Under this user, when I add a domain people can access to my site via pop.domain.com, mail.domain.com, smtp.domain.com and www.domain.com I want to let people only access from www.domain.com This problem doesn't occur on shared ip. How can I solve this problem? I'll also use SSL certificate.
 
I want to ask a general question. Isn't it a bug of directadmin? Because it is bad for SEO and I think directadmin should automaticly prevent it . Why is it create A records for ftp, pop, mail and smtp with the same adress? If create, why it doesn't warn me about this?
 
I am pretty sure it does already. Check your dns templates in /usr/local/directadmin/data/templates
 
I am a newbie and I try to understand dns records. What happens if I remove ftp, smtp and mail A records? Why I point to server's ip? For example can it be cause to drop my mails to junk?

Also I wonder about only am I suffer from this situation or is it a general directadmin situation? I've never seen a question like this on the web. Am I doing something wrong?
 
I am a newbie and I try to understand dns records.

Sorry to say that, if this is the case, then you'd better read some official FAQs and DOCs on the subject. Directadmin forums are not the best place to learn basic things about types of DNS records.

See these links (found with Google):

http://needforair.com/blog/2012/04/22/dns-redirections/
http://www.d2digital.co.uk/blog/a-beginners-guide-to-dns-domain-name-system.aspx

What happens if I remove ftp, smtp and mail A records?

You won't be able to access FTP server by ftp.domain.com, only by (www.)domain.com or IP, if you delete ftp.
You won't be able to access SMTP server by smtp.domain.com, only by (www.)domain.com or IP, if you delete smtp.
You won't be able to access SMTP/POP3/IMAP server by mail.domain.com, only by (www.)domain.com or IP
You won't be able to receive emails at your domain, if you delete mail, as it used for MX record.

Why I point to server's ip?

To avoid a situation, when your site opens by ftp.domains.com, smtp.domain.com, etc.

For example can it be cause to drop my mails to junk?

No

Also I wonder about only am I suffer from this situation or is it a general directadmin situation?

I still don't see anything wrong with the settings and records, and they are good enough for the most cases.

I've never seen a question like this on the web. Am I doing something wrong?

Nobody knows but you. If you need an answer on this question, somebody should check your server and directadmin installation.
 
Back
Top