Wildcard Subdomains and IP in Browser

Hi,

I have two domains on my Linode, nserv.org and bytilly.com - the former is the hostname.

I have followed the instructions to allow for wildcard domains to resolve to the www version, but anything .nserv.org seems to resolve to bytilly.com, and anything .bytilly.com works. My IP is 178.79.190.215 and if you put that in the browser, it resolves to bytilly.com.

Maybe the two problems are linked, but how do I make the IP in the browser resolve to the hostname nserv.org and how to I make the nserv.org wildcard subdomains resolve to nserv.org and not bytilly.com?

Many thanks,

Simon

1 Reply

Hi! From what I can tell your DNS is set up properly, since both your sites (plus their wildcard subdomains) are pointing to your IP:

dig +short bytilly.com
178.79.190.215

dig +short nserv.org
178.79.190.215

dig +short hello.bytilly.com
178.79.190.215

dig +short hello.nserv.org
178.79.190.215

I'm also showing you're running Apache:

curl -IL bytilly.com
HTTP/1.1 200 OK
Date: Mon, 26 Aug 2019 17:20:02 GMT
Server: Apache/2.4.38 (Ubuntu)

I think you're spot on in saying that the problems are linked, and my guess is that you don't have a name based virtual hosts file for your nserv.org domain. And thus, your server is defaulting to the conf file for bytilly.com.

bytilly.com

/etc/apache2/sites-available/bytilly.com.conf

# domain: bytilly.com
# public: /var/www/html/bytilly.com/public_html/

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@bytilly.com
  ServerName  bytilly.com
  ServerAlias www.bytilly.com

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/bytilly.com/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/bytilly.com/log/error.log
  CustomLog /var/www/html/bytilly.com/log/access.log combined
</VirtualHost>

nserv.org

/etc/apache2/sites-available/nserv.org.conf

# domain: nserv.org
# public: /var/www/html/nserv.org/public_html/

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases
  ServerAdmin webmaster@nserv.org
  ServerName  nserv.org
  ServerAlias www.nserv.org

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/nserv.org/public_html
  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/nserv.org/log/error.log
  CustomLog /var/www/html/nserv.org/log/access.log combined
</VirtualHost>

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct