Custom Domain

How can I add a custom domain?
What does the field domain control mean?

Hello @Nkekere_Tommy_Minimann

You could read about that here

Regards, Dima

I’ve created CNAME DNS record for my domain name antigram.ng and I’ve imputed the domain in the Domain control and Custom Domain fields. But am getting the following error when I do an API call
/ng.antigram E/RTLookupService: Lookup failed BackendlessException{ code: ‘3048’, message: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html’, extendedData: ‘{}’, detail: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html’ }

I know am missing something, what else do I have to do?

hello @Nkekere_Tommy_Minimann

the domain antigram.ng can not be resolved, when I call ping I get the following result:

ksv510@Sergeys-MacBook-Pro ~ % ping antigram.ng
ping: cannot resolve antigram.ng: Unknown host

but should something like the following

ksv510@Sergeys-MacBook-Pro ~ % ping develop.backendless.com
PING develop.backendless.com (216.87.89.89): 56 data bytes
64 bytes from 216.87.89.89: icmp_seq=0 ttl=53 time=146.109 ms
64 bytes from 216.87.89.89: icmp_seq=1 ttl=53 time=145.703 ms

also, you have added the domain to Domain control section, but you should add it to Custom Domains section

I have paid for the domain name antigram.ng but I don’t have a website yet. Could this be the reason why you get the “cannot resolve host” error? I have removed the domain from the domain control field, but what is that field meant for? Should I input “*”? Meaning “all domains”?

Hello @Nkekere_Tommy_Minimann

Is your applicationId C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00?

I looked and the domain antigram.ng is still present in Domain Control.

Please look at the documentation (Domain Control (CORS)) it describes what this field means.

Regards,
Vladimir

I removed antigram.ng from domain control but after saving it reverted back. But I’ve been able to successfully remove it now. I replaced it with a “*”. Am still getting the errors.

Hello @Nkekere_Tommy_Minimann,

which error are you getting? Which API call are you doing?

ng.antigram E/RTLookupService: Lookup failed BackendlessException{ code: ‘3048’, message: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html ’, extendedData: ‘{}’, detail: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html ’ }

I get this error when I do Backendless.Data.of(“Master”).find…
And any other API call that accesses my tables.

I think the problem arises from Backendless.initApp(context, APPLICATION_ID,API_KEY)
Am still using my app id and API key when calling this function. How do I call this function now that I have added a custom domain?

Update:
I searched your blog and I saw the correct initialization
Backendless.initApp(this,“https://antigram.ng.backendless.app”)
But I now get error that says:
“Internal client exception, Hostname ‘antigram.ng.backendless.app not verified’”

The hostname of “antigram.ng.backendless.app” does not look correct. I suggest you read the documentation about app initialization and the domain assigned to your app here:
https://backendless.com/docs/js/setup.html

Regards,
Mark

I followed the sample here:
https://backendless.com/docs/android/setup.html

I’ve done it right now, and I get the error:
"Unable to resolve host ‘antigram.ng’: No address associated with hostname. This happens when I use “https:/antigram.ng”. But when I use “https:/www.antigram.ng” I get error: “Hostname www.antigram.ng not verified”
Detail: javax.net.ssl.SSLPeerUnverifiedException

Hi @Nkekere_Tommy_Minimann ,

Before you proceed to your SDK configuration you should configure correctly your custom domain. Exception which you have received caused by missing configuration. I have checked your app “Custom Domains” section and it is empty. Also I tried to add your domain and received error with message that CNAME record for this domain is not configured properly or missing.

Please follow carefully steps from this documentation to configure your domain properly Custom Domain Name - Backendless REST API Documentation

When you complete configuration, try to open your web site in browser. If everything was done correctly you will see content of this page from application File Service /web/index.html .
You should be able to open that page in browser and only then proceed further to SDK configuration.

Regards, Andriy

I understand that the DNS records for my domain name antigram.ng is currently in propagation so i have to wait for it to complete before i can add the domain in the Custom
domain field, and then i can call
Backendless.initApp(getInstance(),“https://www.antigram.ng”);
But while the records are propagating i’ve discovered that i cant even initialise with
Backendless.initApp( getBaseContext(), App.APPLICATION_ID, App.API_KEY ); to continue my development for the time being. I get error:
Error:BackendlessFault{ code: ‘3048’, message: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html’, detail: ‘Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html’, extendedData: ‘{}’ }Session timeout. Url: https://api.backendless.com/C2AE98FF-1A1D-BF10-FF3E-64CD97C40D00/8CEED2B4-5913-410D-ABB7-28AAACD3178A/page/session_expiration/index.html
How can i get back to using my app id and key for initialization while waiting for my DNS records complete propagation before i can switch to initializing with domain name?

I also need to point out that I don’t have a website, I just registered the domain name antigram.ng

@Nkekere_Tommy_Minimann ,

This is strange indeed. Custom domain presence does not affect initialization by application ID and API key.
In your case it looks like there is some problem with authenticated user session renewal.
Could you please provide minimal working example of code in which this exceptions occurs? Also specify version and type of Backendless SDK which you are using.

I also need to point out that I don’t have a website, I just registered the domain name antigram.ng

I understood it. Your registered domain will lead nowhere till you complete configuration steps from this page Custom Domain Name - Backendless REST API Documentation. Only after that your Backendless application will be available under that domain as your website.

Regards, Andriy

The exception occurs immediately I initialise Backendless in my Singleton class. This is the first code that gets called before any other code

Backendless.initApp( getBaseContext(), App.APPLICATION_ID, App.API_KEY );

“Your registered domain will lead nowhere till you complete configuration steps from this page Custom Domain Name - Backendless REST API Documentation. Only after that your Backendless application will be available under that domain as your website.”

What I understood this to mean is that I have to create a CNAME record under my domain antigram.ng and map to “develop.backendless.com”. I have done this already and the DNS is propagating.

“Only after that your Backendless application will be available under that domain as your website.”

Am confused by this phrase because like I said there is no website. I hope what u mean is simply
“Only after that your Backendless application will be available under that domain.”

Am using Backendless Java SDK 6.2.1

Update:
Since u mentioned this:
“This is strange indeed. Custom domain presence does not affect initialization by application ID and API key.In your case it looks like there is some problem with authenticated user session renewal.”

I uninstalled and reinstalled the app and the problem went away.
Thanks.
Now I await my DNS records to propagate completely so I can initialise with
Backendless.initApp(getInstance(),"www.antigram.ng”);

The CNAME record i was instructed to add for the domain www.antigram.ng has propagated completely and i have successfully added the domain in the custom domain section
but am still getting the following error when i initialise with Backendless.initApp(getInstance(),“https://www.antigram.ng”);

2022-01-16 14:42:00.383 28839-28839/ng.antigram E/ng.antigram.Activities.MainActivity$1: Error:BackendlessFault{ code: ‘Internal client exception’, message: ‘Hostname www.antigram.ng not verified:
certificate: sha1/b3mV22nTrG+RTdXE2TS6H6oz9vs=
DN: CN=.backendless.app
subjectAltNames: [
.backendless.app, backendless.app]’, detail: 'javax.net.ssl.SSLPeerUnverifiedException: Hostname www.antigram.ng not verified:
certificate: sha1/b3mV22nTrG+RTdXE2TS6H6oz9vs=
DN: CN=*.backendless.app

Hello @Nkekere_Tommy_Minimann!

This is because https is not available on the Springboard plan, and you must upgrade to a Cloud99 plan to use it.

Regards,
Alexander

I changed to http and now I get the error : Cleartext HTTP traffic to www.antigram.ng not permitted.
Does this mean I can’t test this feature until I upgrade to cloud 99?