Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-03-28, 12:16:16

Author Topic: Host any domain pointing to server IP?  (Read 5299 times)

0 Members and 1 Guest are viewing this topic.

Offline djelica

  • Junior Member
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Host any domain pointing to server IP?
« on: 2017-09-03, 03:29:48 »
Hello there, i need help regarding this task that bothers me for quite long time.
I have to host some 300+ domains on single IP. Those domains have glue record at registrar (i believe its called like that) pointing to my server's ip address. What I want to achieve is host them all without going through process of manually adding every single domain through panel. Those domains don't even have to to show up in panel, just need to resolve successfully and serve files normally.

All domains have same setup, lets assume following scenario
ns1.mydomain.com and ns2.mydomain.com point to my server's IP address.
ns2.mydomain2.com and ns2.mydomain2.com point to my server's IP address.
I created default dns template in panel and when i add domains regularly through domains section in panel it all works but it wont work without adding and that is wanted outcome.

What I tried so far:
Creating default dns template, adding *master* domain regularly and assign IP to that domain through home->ip addresses->configure domain. Didn't work.
Added admin as exclusive client, that didnt work too.
Added wildcard (*) A record in dns template, rebuilt. Didnt work.
Added server alias (*), i believe this is same as above, didnt work too.

intodns.com is showing one error that i think is meaningful:
Code: [Select]
ERROR: One or more of your nameservers did not respond:
The ones that did not respond are:
111.111.111.111 (my ip there)

sysinfo:
Code: [Select]
# sh sysinfo

A. Kloxo-MR: 6.5.0.f-2016091701

B. OS: CentOS release 6.8 (Final) x86_64

C. Apps:
   1. MySQL: mysql55-5.5.52-1.ius.el6.x86_64
   2. PHP: php53u-5.3.29-1.ius.el6.x86_64
   3. Httpd: --uninstalled--
   4. Lighttpd: --uninstalled--
   5. Nginx: nginx-1.11.4-1.el6.ngx.x86_64
   6. Qmail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - with: courier-imap-toaster-4.1.2-1.3.20.mr.el6.x86_64
   7. Dns: bind-9.9.7-1.mr.el6.x86_64

D. Php-type (for Httpd/proxy): mod_php_ruid2

Help greatly appreciated!

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Host any domain pointing to server IP?
« Reply #1 on: 2017-09-03, 04:31:48 »
1. Assign domain to IP only possible if you have more then 1 IP where 1 IP (usually main IP) as shared IP and other IP to assign to certain IP. Remember, assign IP only for 1 IP for 1 domain.

2. Set 'ns1.master.dnst' in 'primary dns' and 'ns2.master.dnst' in 'secondary dns' in dns template. With this setting, yourdomain1.com will be have 'ns1.yourdomain1.com' and 'ns2.yourdomain1.com' for 'NS record' (Kloxo-MR will be convert 'ns1.master.dnst' to 'ns1.yourdomain1.com' and so on).

Read https://forum.mratwork.com/kloxo-mr-tips-and-tricks/(tip)-how-to-set-dns/

Also click 'help' under 'dns template' for description.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djelica

  • Junior Member
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Host any domain pointing to server IP?
« Reply #2 on: 2017-09-03, 16:04:10 »
Hello again MR,
unfortunately that didn't work.
Here's how my template looks like with name "master"

Code: [Select]
Hostname Type Priority Value
* A - 111.111.111.111
__base__ A - 111.111.111.111
cp A - 111.111.111.111
mail A - 111.111.111.111
ns A - 111.111.111.111
ns1 A - 111.111.111.111
ns2 A - 111.111.111.111
ftp CN - __base__
lists CN - mail
webmail CN - mail
www CN - __base__
master.dnst MX 10 mail.master.dnst
ns1.master.dnst NS - ns1.master.dnst
ns2.master.dnst NS - ns2.master.dnst

I managed to get wanted outcome with modifying kloxo bind master template file as explained on this link: https://serverfault.com/questions/396958/configure-dns-server-to-return-same-ip-for-all-domains/397011#397011
That worked out but I don't like setting up stuff through hacks and backend files modification instead of being able to do the same through panel itself.
« Last Edit: 2017-09-03, 16:05:47 by djelica »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Host any domain pointing to server IP?
« Reply #3 on: 2017-09-03, 16:14:37 »
Did you set 'child nameserver' and 'nameserver' in domain panel (from domain provider)?. Also did you set 'rebuild' using this template for your domains?.

Also, try 'sh /script/fixweb; sh /script/restart-dns' from ssh.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djelica

  • Junior Member
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Host any domain pointing to server IP?
« Reply #4 on: 2017-09-03, 16:26:15 »
I did rebuild using this template but not for domains (plural) I did for 1 domain which I assigned to specific IP i want to use.

To answer your first question im not sure what is child nameserver. In domain provider panel i have ns1.domain.tld and ns2.domain.tld pointing to my IP.

I did not try running fixweb and restart-dns (i believe fixweb wont have any effect since domains aren't present in home->domains in kloxo panel). Once I comment out my 'hack' in template file and do rebuild dns for my particular master domain and do "service named restart" other domains pointing to that IP don't work anymore. When I uncomment and re-do those steps domains work and intodns error from above disappears.

Just for reference, template I'm referring to is list.master.conf.tpl
« Last Edit: 2017-09-03, 16:28:54 by djelica »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Host any domain pointing to server IP?
« Reply #5 on: 2017-09-03, 16:45:47 »
Don't use assign IP to domain if you have 1 IP only.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djelica

  • Junior Member
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Host any domain pointing to server IP?
« Reply #6 on: 2017-09-03, 16:48:20 »
My server has multiple IPs

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Host any domain pointing to server IP?
« Reply #7 on: 2017-09-03, 16:50:51 »
What's the reason want assign IP to domain?.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline djelica

  • Junior Member
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Host any domain pointing to server IP?
« Reply #8 on: 2017-09-03, 17:03:34 »
Im not exactly sure what you ask. If you ask why I assign domain to IP in panel its because i dont see any other way that extra domains find appropriate path in system.
If you ask why I want to host multiple domains on one IP, this has wide use cases. One example would be If i work with domains buying/selling I can just point to IP from registrar for all bought domains without having to separately add each and every single of them in kloxo. Other use case would be wordpress multisite which can work if i go through adding every single domain but going through that process hundreds times is not so practical. And so on.

I confirm that 'hack' from link i posted works as expected but that will be gone if I ever execute some function from /script/ that would overwrite template file and that is main reason why I want to do it through panel.

But, if this is something very advanced for kloxo (being free panel) feel free to skip on this one since i found solution.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Host any domain pointing to server IP?
« Reply #9 on: 2017-09-03, 17:08:34 »
Im not exactly sure what you ask. If you ask why I assign domain to IP in panel its because i dont see any other way that extra domains find appropriate path in system.
If you ask why I want to host multiple domains on one IP, this has wide use cases. One example would be If i work with domains buying/selling I can just point to IP from registrar for all bought domains without having to separately add each and every single of them in kloxo. Other use case would be wordpress multisite which can work if i go through adding every single domain but going through that process hundreds times is not so practical. And so on.

I confirm that 'hack' from link i posted works as expected but that will be gone if I ever execute some function from /script/ that would overwrite template file and that is main reason why I want to do it through panel.

But, if this is something very advanced for kloxo (being free panel) feel free to skip on this one since i found solution.
You only need 1 IP for your all domains. You need update Kloxo-MR 6.5 to 7.0 if want to use free ssl beside all other new features.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

 


Top 4 Global Search Engines:    Google    Bing    Baidu    Yahoo
Click Here

Page created in 0.069 seconds with 23 queries.

web stats analysis