Setting Windows server as NTP server but keeping client settings untouched - window

I'm working on an installation module (C#) for a distributed system.
One of the requirements is being able to setup one of the servers as an NTP server (windows time service).
I've followed several MS articles, for example:this one
but it seems that each one also requires to configure the NTP client settings (for example changing the server type from Nt5DS to NTP).
Any idea of how to keep a server's existing NTP client settings untouched while setting it as NTP server?
Thanks,

After investigating this issue for a while, looks like that's impossible.
After reading this post, I understand that the same registry key is used for both NTP client and server protocols, meaning, if the same machine needs to be a client and a serve but the client should work with, let's say, NT5DS and the server's protocol is obviously NTP than it can't work.

Related

Embedded Linux distribution executes a NTP client not intentionally installed. But which?

I'm trying to manage the system time of an yocto-base Linux distribution (zeus release) by NTP (Network Time protocol).
I know that an available NTP client is ntpdate, bu without installing ntpdate, the system time synchronizes itself with a not known NTP server.
The system is connected to Internet by a WiFi network and if I disconnect it from Internet the date synchronization stops.
This proofs that there is a process running on my distribution which set the system date by a connection to a not known NTP Server.
Because the distribution comes from the yocto core image core-image-minimal.bb, it is one of the packages installed by it which adds a NTP client to the distribution.
But which is this client?
I hope I was clear! Don't hesitate to ask for more details.
By default (and so without that I know it) in my Linux distribution has been installed the systemd service: systemd-timesyncd.
This service starts automatically at boot and, by default, try to connect to one of the following public NTP Server:
time1.google.com time2.google.com time3.google.com time4.google.comtime1.google.com time2.google.com time3.google.com time4.google.com
So it is systemd-timesyncd that gets the UTC date and time from one of the previous servers.
About the list of default NTP servers it is useful read the following info from the timesyncd.conf man page:
CONFIGURATION DIRECTORIES AND PRECEDENCE
The default configuration is defined during COMPILATION, so a configuration file is only needed when it is necessary to deviate from those defaults. By default, the configuration file in /etc/systemd/ contains commented out entries showing the defaults as a guide to the administrator. This file can be edited to create local overrides.

Microservice HTTP port problem on Windows Server

We have written (in Go and Delphi) several Windows microservices, which respond to HTTP requests on specific ports in the 11000-12000 range. These are designed to run internally within the Domain or Private network of the client (i.e. not on the internet).
They run perfectly on all but one of our 50+ client systems, on OS's ranging from Windows 7/10/11 to Windows Server 2008R2/2012/2016/2019. The installation process for each of these services sets up rules in the Windows firewall to accept the requests to each service exe.
The one client system that they dont work on is running Windows Server 2016 Essentials. This is the only client system running that specific OS, so that may be a factor in the problem.
Even locally using a web browser on that system to query the services they dont work. The requests just wait for a while and then timeout: ERR_CONNECTION_TIMED_OUT.
However the same requests to the same ports at address 127.0.0.1 (localhost) work instantly - proving the services are actually running.
The mode of failure when the targeted service is not running, or if we address the wrong port, is different. In that case we get a quick "refused to connect" failure: ERR_CONNECTION_REFUSED
There are no third party antivirus or firewall products installed on the system, which is only using Windows Defender with the normal Windows firewall. We've tried everything we can think of with the Windows firewall, including turning it off completely. Nothing we've tried made any difference.
We've tried using many alternative port numbers, but we dont get any success until we get up to the 49000 range and above, but we'd really rather not have to change from our normal port number range unless its completely unavoidable.
We've spent many hours trying to find any solution without any luck. We are really hoping that some bright person out there has some idea that will lead to finding the cause of the problem.

How can I sync my computer time with a specific website?

How can I sync my computer time with a specific website?
i want to my computer time is exactly same with this site:
http://www.tsetmc.com/Loader.aspx?ParTree=15131F
You can only sync your computers to a specific server, if that server provides an interface (normally via ntp) to publish its clock's time. If the server you want to use doesn't provide such a service, then the best you can do is to sync your computer's clock to a public NTP server.
One thing you could do is to ask the site's administrator whether the server is providing ntp services, or what public NTP server they are using to keep that server's clock in sync, and also sync your machine against that one.

Slow access to Tomcat web application from another PC

The access to my web application running Windows 2008 Server on localhost is fast; however, when I tried to access the web application through another PC (exp: http://xxx.xxx.xxx.xx:8080/appname) is takes about one minute to load a simple login page. Any input regarding this matter is much appreciated.
Further information, the firewall is already off and the setup within a LAN environment without Internet access.
With this little information it is almost impossible to debug your situation. However, I'll take a guess based on what you've provided.
If you're running on an internal LAN, the problem is likely that you don't have reverse DNS configured for your server. Your server has some made-up name for which only forward-DNS exists. When Tomcat receives a request it tries to look up the hostname based on the IP address, and this can take a long time to time-out.

How do I determine the identity of a Windows machine?

I have a program consisting of a server and a client processes. Both run on Windows systems - Windows 2000 or later versions. The two processes can run on the same machine or on two different machines.
How can the client determine if it is run on the same machine as the server? If the server is not running the client can't work anyway and doesn't care where the server possibly is - so this case is out of the question. I've heard that each Windows machine has an UUID - can I obtain it and use for that purpose?
Windows networking requires computer names to be unique, so calling the GetComputerName api and having the client and server swap names (and compare the received name to the name they see) should suffice. If the client and server can start up independently of one another then you'll need some sort of protocol for this process. It seems logical for the client to initiate the exchange, and the server to only send its name when it has received a name from a client. The client can then abort the connection if it sees the same name.
I believe most virtual machine systems will allow the virtual machine to have its own name, so it should still be possible for you to test on virtual machines. However I don't have extensive experience of all the virtualisation technologies out there, so can't say for sure.
Previous question about generating a unique machine id that might help.
Link to previous answer which mentions MachineGUID
It is straightforward to add an API to the server that reports its machine name. The environment variable is COMPUTERNAME. The client could check that, right?
Do you need to deal with any of these cases?
The client is running, but the server is not responding, and you want to know whether the unresponsive server is on a remote machine.
The client and the server are running in two distinct virtual machines on the same host machine, and you want to report that as "running on the same machine."
The client is running in a virtual machine hosted by the same machine as the server is running on, and you want to report that as "running on the same machine."
The client and the server are running on uncoordinated networks and both might have been assigned the same name.
The server is possibly hostile, and will attempt to deceive the client.
The network card will have a unique MAC. If both server and client report the same MAC then they are using the same network card. If both client and server are running in different virtual machines but using the same network card, do you consider them running on the same machine or different machines?
how about trying to establish a loopback tcp connection? or maybe checking for some lock file created by the server in a predefined folder...
I don't know exactly how, but there's for sure something equivalent in Win32 to the /proc filesystem in Unix (I think there are free replacements for the windows taskmanager, maybe you could look at their sources) where you could search for your server process.

Resources