Jump to content
  • 0

Domain nameservers not returned correctly


deepaktsw

Question

Hello, 

I am facing a weird issue with my WHMC site. 

I am using a custom Domain registrar module, it fetches the nameservers correctly using its API to be double sure I even hardcoded it like this
 

return array(
                'success' => true,
                'ns1' => 'test1.com', 
                'ns2' => 'test2.com',
                'ns3' => '',
                'ns4' => '',
                'ns5' => '',
            );

This returns the name servers from the registrar module . However, on the client area nameservers page in the template the first nameserver, ns1 shifts to ns2 and so on. And ns1 value is simply 'true' and this is why it appears something like this
image.thumb.png.88cb34dbc0f45702e6e7dd36f58d7cc9.png

What is the fix for this? I turned on debug in the template I am getting the values like this - 

 

Value
Array (6)
1 => Array (3)
  num => 1
  label => "Nameserver 1"
  value => true
2 => Array (3)
  num => 2
  label => "Nameserver 2"
  value => "ns40.sbc-dns.com"
3 => Array (3)
  num => 3
  label => "Nameserver 3"
  value => "ns41.sbc-dns.com"
4 => Array (3)
  num => 4
  label => "Nameserver 4"
  value => ""
5 => Array (3)
  num => 5
  label => "Nameserver 5"
  value => ""
6 => Array (1)
  value => ""

 

please help. Thanks

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Though the example for registrar modules give 'success' in the return, code I have seen for registrar just has the nameservers.  What happens if you remove the success row?   From what you have provided, it seems WHMCS is trying to use that as nameserver . 

Link to comment
Share on other sites

  • 0

Found: it's a bug in the sample-registrar-module available on GitHub.
sample-registrar-module is very old, and maybe it worked fine with very old versions of WHMCS... but it's not so anymore.

 I've just opened a pull request on GitHub: https://github.com/WHMCS/sample-registrar-module/pull/12

The fix is very easy: in registrarmodule_GetNameservers function, just delete following line:

'success' => true,

@WHMCS John, please take a look and approve the pull

Link to comment
Share on other sites

  • 0
18 hours ago, Remitur said:

Found: it's a bug in the sample-registrar-module available on GitHub.
sample-registrar-module is very old, and maybe it worked fine with very old versions of WHMCS... but it's not so anymore.

 I've just opened a pull request on GitHub: https://github.com/WHMCS/sample-registrar-module/pull/12

The fix is very easy: in registrarmodule_GetNameservers function, just delete following line:


'success' => true,

@WHMCS John, please take a look and approve the pull

Wow, nice find.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated