Server URL format

Andy Barnard3 years ago

Hi,

A really simple question, and I'm surprised that I haven't been able to find a definitive answer from the forum, although there were some questions along a similar line which indicated this should work....

In the traccar client (version 6.17 running on Android 11, Xiaomi MIUI 12.5.8 global)

  • if I enter the server URL with an IP address like: http://XXX.XXX.XXX.XXX:5055 it works
  • if I enter the server URL with the A-record that points to that IP address like: http://remote.myserver.org.uk:5055 it doesn't work

As the client is on an Android device, I would have assumed that DNS lookup URL to ip address should be OK. Am I doing something wrong?

regards,
Andy

Anton Tananaev3 years ago

Both URLs should work just fine, assuming DNS is configured correctly and there are no issues with your phone.

Andy Barnard3 years ago

Thanks for the quick answer, most helpful.

Yes I was doing something wrong and in case it helps anyone else:

  • from 4G network, both ip address and FQDN worked
  • when using WiFi in the same location as the traccar server, the local DNS server was failing to resolve the correct (local) host as a result of a local DNS misconfiguration
  • when in a separate location from the traccar server both ip address and FQDN worked whether on WiFi or 4G

All working now, thank you.

ac2 years ago

I have the exact same problem when I set up a new version Linux server recently. Any suggestions with the DNS settings so I can fix the issue?
Using Linux Ubuntu 22 server edition with traccar 5.3.
Thank you

Andy Barnard2 years ago

The simplest options are the three I listed above. If you really need to use the DNS FQDN locally then there are a number of solutions the easiest of which is to manually configure the local DNS server to interpret the FQDN as the local IP address of the traccar server.

In the end I just turned off WiFi on the traccar clients so they never connect that way.

ac2 years ago

Thank you Andy, I am in search of a permanent solution to this so if I find something with the apache settings I will post here. Out is curiosity, what server are you using?

Andy Barnard2 years ago

Our local DNS server is windows server SBS 2019 which forwards unresolved DNS queries to the ISPs DNS servers. We do resolve some names locally (e.g. for email), but chose not to do so for traccar clients which in operation are in vehicles only. The Traccar service is running on a separate Windows 10 VM. We have a static IP address so can choose either IP address or FQDN in the traccar client URL without any complications such as dynamic DNS.