Windows 10 DNS client crashes and I'm unable to restart it - dns

For some time I'm facing a very frustrating situation, all of a sudden every internet connection that uses domain instead of IP start failing. Active connections continue working, softwares that had cached the IP continue starting connections, IP connections work, but anything that requires DNS resolving stops. Only solution I had found is to restart Windows.
I had diagnosed that Windows DNS client/dnscache is crashing. I tried to restart it but I'm unable to, because it runs under Network Service account.I found https://superuser.com/questions/1277952/how-to-troubleshoot-a-windows-10-service-which-does-not-let-me-stop-it with the same exact issue, everything is grayed out and I can't change anything. I don't wanna disable it, only stop and restart.
That question has an answer explaining how to do it, but it seems that on last Win10 versions it stopped working too.
I understand M$ did that to restrict access to these services, but dnscache is crashing and I'd rather restart it than the whole OS.

If you use the taskkill command and start command on the same object on the same line (separated by &) it stops and reopens the task which restarts the task. This can be seen the most with explorer.exe which when you close explorer with taskkill /f /t /im explorer.exe && start explorer.exe while you have blue light filter on, the blue light filter will flicker because of the close of explorer.exe and also every app will still stay up as oppose to when you put these two commands on different lines where everything will close. If you know the name of your service you want to restart, you can use:
taskkill /f /t /im "<name of process>.exe" && start <name of process>.exe
and put it in a file with the .bat file extension. This should work, if you have any questions, just ask them in the comments below.

Related

Kill windows process that keeps restarting

I am trying to stop a windows service that is using a port I need, but the service keeps restarting it self. How do I stop it from restarting itself?
I followed this question to kill it (How to kill the process currently using a port on localhost in windows?), but when I listen for the port again a new service started already:
How this happened and some notes:
I created a Nodejs service and started it as a windows service (so now it is running in it's own windows instance)
My service had a cmd line to stop it self net stop "Service Name". This semi-failed for some reason (it did stop, kinda, but then it starts again)
I have even uninstalled the Nodejs service completely, but still something is starting it up over and over (because the port stays in use)
I can't move the Nodejs service files, because they are in use
To find out what application/service the PID is referring to, you can open Resource Monitor by running: resmon
Then choose CPU tab and look for the PID, Note: it could be under Processes or Services. If it's a service then you can stop and disable it so it won't run again.
If it's a Process, the name should give you an idea what it is.

NodeJS - how to make a process to auto restart when issue occurs?

I am running some application in NodeJS that retrieves data from a database and serve at port 3000.
It is running fine most of the time but sometimes it just errors out (it could be too many connections or network issue or some sql injection etc.). This happens every 2-3 days randomly.
While I am figuring out root cause - what is the best way to have NodeJS always 'ON' - meaning if it stops running - some process kicks it and it starts again?
You can use forever as stated by the previous answer, but as I've worked with forever before, I'd suggest using the pm2 process manager. It has, on top of what you need, some more advanced functionalities and is well-documented.
Try this:
forever start -w <filename>
-w is for watch. it watches the file changes and restarts if any changes found.
Also, if the script is unexpectedly stopped, it will try to restart it.
forever list for details of the process.
you will see the PID, filename, log filename.
in the log file, you can see the log of your script.
Hope it helps. :)

TortoiseSVN is running very slow

TortoiseSVN application is running very slow.
Ít waits too long when trying to open Repo-browser or updating. It keeps showing the message "Please wait while the repository browser is initializing".
Then after waiting for 10 mins or so, it shows up the credential window, and then again a long wait.
I installed command line sliksuberversion, and updates from command line using subversion run as normal, from which I deduced that there is no OS or network related issue.
I enabled debugLogs, and got the following:
The timestamps show the delay. Eventually the server connection times out, due to the delay.
Please suggest.
Thanks for your suggestions and time on this. The issue was traced to ICMP not accessible in server machine, because it was not different subnet. I was able to ping the machine using domain name, but not by IP (this statement is correct, and it was not the other way round). What was surprising was the subversion was working fine, but not tortoise, which probably indicates that tortoisesvn has an additional network step (ping or something else) in their process over subversion. Thanks again.
I encountered the same. It worked before, and started after I was moved from cubicles to cubicles with maybe network reset although my IP address remains the same.
It works again after run ipconfig /renew and restart TortoiseSVN client.

ASP.Net Restart IIS

Long story short -- we have 2 webservers that run a 3rd party asp.net application. Randomly (so far) they just...stop working. I have an outside check that will tell me when it stops working within a minute or so. Right now I have to get onto the machines through RDP and issue an iisreset. Which is fine until I'm not at a machine and I have to get to one PDQ.
I wrote a simple page that will issue an iisreset on the offending remote machine(s). This works, usually. Sometimes "iisrestart \machinename" will stop the IIS service, but not restart it, which is bad.
Ideally, I'd like to know if I can just stop the service, try to start it, and if it doesn't start in 10 seconds, try to start it again. But I don't know how to monitor the status of a service remotely.
Can someone point me in the right direction?
This is the right direction: VBScript and WMI to stop, monitor, start the service on the remote machine.

Port 80 is being used by SYSTEM (PID 4), what is that?

I am trying to use port 80 for my application server, but when I perform netstat -aon I get:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
When I look up the process in task manager, it shows PID 4 is SYSTEM, that's it. No extension... nothing. Just "SYSTEM". What's going on here?
I'm afraid to end this process, what do I do?
There are many services, which can listen port 80 on windows.
Luckily you can detect and stop them all running simple console command:
NET stop HTTP
When you'll start it, you will get list first:
To avoid this problem in future go to Local Services and disable listed services.
N.B. - Some services will restart themselves immediately, just run 'NET stop HTTP' few times.
A new service called "Web Deployment Agent Service" (MsDepSvc) can also trigger "System" with PID=4 to listen on port 80.
Also, try stopping "SQL Server Reporting Services (MSSQLSERVER)", that apparently defaults to 80. I did that and port 80 freed up. PID identified the culprit as "System", but apparently that System can mean multiple things.
I had the same problem. Could fix it by stopping the World Wide Web Publishing Service under running services.
the IP adress is 0.0.0.0, state = LISTENING: means that port 80 is listening to all interfaces (not used)
How to read NETSTAT -AN results:
https://sites.google.com/site/xiangyangsite/home/technical-tips/linux-unix/networks-related-commands-on-linux/how-to-read-netstat--an-results
This works for me:
Right click on My Computer.
Select Manage.
Double click Services and Applications.
Then double click Services.
Right click on "World Wide Web Publishing Service".
Select Stop.
It sounds like IIS is listening to port 80 for HTTP requests.
Try stopping IIS by going into Control Panel/Administrative Tools/Internet Information Services, right-clicking on Default Web Site, and click on the Stop option in the popup menu, and see if the listener on port 80 has cleared.
Working solution - tested on Windows 10
There are many reasons for this, the one cause/solution I recommended is this:
Open Command line as Administrator, then:
stop http service
net stop http /y
configure 'http' service to be disable by default
sc config http start=disabled
If above solution does not work, find your specific case - here
Restart your web server/XAMPP/Apache and you're done.
To re-enable http service
use
sc config HTTP start= demand
the source of explanation is here
https://web.archive.org/web/20190917190806/http://servicedefaults.com/10/http/
I've found out that "SQL Server Reporting Services (MSSQLSERVER)" starts automatically and listens on port 80.
I hope this helps.
O
This can be very easily fixed by following these five steps:
Open Services
Right click on World Wide Web Publishing Service
Click STOP
To prevent this issue in future :
Go to Properties
Change Startup type to Manual
Viola u are good to go !
For more info on root cause: https://serverfault.com/questions/65717/port-80-is-being-used-by-system-pid-4-what-is-that
An other service that could occupied the port 80 is BranchCache
services.msc showing it as "BranchCache"
or use the net command to stop the service like
net stop PeerDistSvc
Update:
PeerDistSvc is a service behind svhost.exe, to view svchost services type
tasklist /svc /fi "imagename eq svchost.exe"
The issue is how to free it up, simply use
net stop http
https://stackoverflow.com/a/16243333/777982
I knew these answers were right , but my services.msc was not showing the services, however this did the trick:
sc stop "MsDepSvc"
sc config "MsDepSvc" start= disabled
netsh http show urlacl
The command is mentioned in a previous comment but I'd like to bring it up as an answer. It will get you all reserved URLs in the system. If you look through all records with "80" in URL, you shall have your answer.
For example, in my case, I got:
Reserved URL: http://+:80/Temporary_Listen_Addresses/
User: \Everyone
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;WD)
Reserved URL: http://+:80/0131501b-d67f-491b-9a40-c4bf27bcb4d4/
User: NT AUTHORITY\NETWORK SERVICE
Listen: Yes
Delegate: No
SDDL: D:(A;;GX;;;NS)
After a quick Google search, I learnt that "NT AUTHORITY\NETWORK SERVICE" belongs to SQL Server. So I went to Services and stopped SQL Server Reporting Service, port 80 is free again as I check netstat -a -b
I just got this problem today, since it showed up after Norton requested reboot I blamed Norton.
But it wasn't Norton, I removed Norton, rebooted -> problem still there.
netstat -nao was showing that PID 4 owned my port 80 connection.
I then went to control panel,
then "Turn Windows features on or off"
then unchecked Internet Information Services.
Rebooted, the problem went away.
My xampp server is running ok now.
I don't ever remembering turning IIS on in the first place.
I had been running many months before this happened.
I still don't know what caused it in the first place.
Maybe a previous windows updated enabled iis and my reboot turned it on, I don't know.
This Process works for me:
Right click on My Computer.
Select Manage.
Double click Services and Applications.
Then double-click Services.
Right click on "World Wide Web Publishing Service".
Select Stop
Restart XAMPP
Identify the process programmatically
All the answers to date have required the user to do something interactive. This is how you find the PID when netstat shows you PID 4, without needing to open some GUI or handle a dialogue about depending services.
$Uri = "http://127.0.0.1:8989" # for example
# Shows processes that have registered URLs with HTTP.sys
$QueueText = netsh http show servicestate view=requestq verbose=yes | Out-String
# Break into text chunks; discard the header
$Queues = $QueueText -split '(?<=\n)(?=Request queue name)' | Select-Object -Skip 1
# Find the chunk for the request queue listening on your URI
$Queue = #($Queues) -match [regex]::Escape($Uri -replace '/$')
if ($Queue.Count -eq 1)
{
# Will be null if could not pick out exactly one PID
$ProcessId = [string]$Queue -replace '(?s).*Process IDs:\s+' -replace '(?s)\s.*' -as [int]
if ($ProcessId)
{
Write-Verbose "Identified process $ProcessId as the HTTP listener. Killing..."
Stop-Process -Id $ProcessId -Confirm
}
}
That really busted my chops. I hate HttpListener and wish I'd just used Pode.
On the lastest version of windows this service is called as "World Wide Web Publishing Service" (W3SVC)
C:\Windows\system32\svchost.exe -k iissvcs
You can stop this service by going to Services (services.msc) and stopping the service and then setting the "Startup type" -> Disabled for preventing it from running on windows startup.
I had this same exact problem, except that i have never used IIS. While I was fixing another system bug, I had set the apache service to manual start, hoping to reduce the complexity of my system. After I fixed the other bug, apache wouldn't start. I futzed for a while, but all it took was setting apache back to automatic start: Start > Administrative Tools > Services.
Apparently when Apache starts this way, it claims port 80 before the SYSTEM process can.
hth someone. all my googling turned up the 'can't have IIS and Apache on the same machine.' this is for the other one percent of us.
For me it worked after stopping Web Deployment Agent Service.
In case you use Razer product and install Razer Synapse software on your PC, it blocks the port 80 too.
It is not included in the netstat command so I am not able to troubleshoot it. Since there are many services included within the software, I can't analyze which one that blocks the port. After uninstalling the Razer Synapse, I can start the Apache server again on Windows 10.
Try netstat -b, that may hopefully shed some light on the situation (showing what .exe is using the port). Good luck.
This wouldn't explain the PID side of things, but if you run Skype, it likes to use Port 80 for some reason.
In my case, it happened after installing Microsoft Web Matrix. Uninstalling this trash along with "Microsoft Web Deploy" fixed the issue.
I was looking around for PID 4 and came to this question. From this answer and a blog post I figured that anything to do with PID 4 is probably a Windows Service, so you may want to look for the relevant services in services.msc.
Also, this process is run by System, which is considered another "logged-on" user.
I had the same problem and it was because of IIS running on the server, you can stop it using IIS Manager if it is the case for you.
If you are running Windows Server 2012 R2 then make sure to get rid of Work Folders: http://blogs.technet.com/b/filecab/archive/2013/10/15/windows-server-2012-r2-resolving-port-conflict-with-iis-websites-and-work-folders.aspx
Removing Work Folders feature under File Server worked for me.
None of these worked for me. I had to go to a SuperUser question.
If it is a System Process—PID 4—you need to disable the HTTP.sys driver which is started on demand by another service, such as Windows Remote Management or Print Spooler on Windows 7 or 2008.
There is two ways to disable it but the first one is safer:
Go to device manager, select “show hidden devices” from menu/view, go to “Non-Plug and Play Driver”/HTTP, double click it to disable it (or set it to manual, some services depended on it).
Reboot and use netstat -nao | find ":80" to check if 80 is still used.
This is the one that worked for me!
BranchCache was my problem. My resolution was to run Powershell as an administrator and run:
Disable-BC -Force
Reference: https://learn.microsoft.com/en-us/powershell/module/branchcache/disable-bc?view=win10-ps
For me I had to uninstall "Citrix Virtual Desktop Agent" on my VM

Resources