Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple domains? #15

Open
vvdan opened this issue Feb 5, 2020 · 4 comments
Open

Multiple domains? #15

vvdan opened this issue Feb 5, 2020 · 4 comments

Comments

@vvdan
Copy link

vvdan commented Feb 5, 2020

Hi,

This may seem silly but I can't seem to add multiple domains.

Im not really great with php/programming but I can't seem to run this for multiple domains, it seems like it's only update the first one.

Here are my settings:

<?php
return array(
  'cloudflare_email' => 'xxxxxxxxxxx@xxxxxxxxx.com',     // the email address yo>
  'cloudflare_api_key' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',   // your >

  'domain' => ['test1.com'],['test2.com'],             // the name of the domai>
  'record_name' => ['test1.com'],['test2.com'],        // the full name of the >
                                // the record(s) must be part of the domain(s>

  'ttl' => 600,                   // a TTL of 1 means "automatic". if you wan>

  'proxied' => false,           // Whether the record is receiving the perfor>

  'protocol' => 'ipv4',         // what protocol to use to get the ip address>

  'auth_token' => ''            // (optional) if set, enable API mode and req>
                                // generate a random string here:

Am I doing anything wrong?

Kindest regards,
Dan

@vvdan
Copy link
Author

vvdan commented Feb 5, 2020

Also tried with 'domain' => array('test1.com',''test2.com'),

still updates first one only

@schliflo
Copy link
Contributor

schliflo commented Feb 5, 2020

Hm, you're correct, that's a limitation of the script. But you can use the updated domain as a CNAME record for the other domains in order to get the same IP there.
Something like this should work:
Screenshot 2020-02-06 at 00 21 38

@lyoshenka
Copy link
Owner

One way you could go is to make multiple config.php files (one for each domain) and pass the config name to the ddns.php script when you run it. You'd have to make a small change in ddns.php to take the config path as an argument. Would that work for you?

@lyoshenka
Copy link
Owner

I also like @schliflo's suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants