I am installing WSUS on Server 2016 and also SQL 2016 on Server 2016. I've tried untinalling both SQL and WSUS, unjoining the domain and rejoining, I tried SQL 2014 and have the same issue. I'm running out of ideas.
When I run WSUS post config either from the GUI or from powershell I get the error "Fatal Error: The trust relationship between this workstation and the primary domain failed." Both servers are connected to the domain and functioning correctly
as far as I can tell. WSUS does talk to SQL long enough to create the DB.
Postconfig command: wsusutil.exe postinstall SQL_INSTANCE_NAME=wsus-sql\wsus2016 CONTENT_DIR=E:\WSUS_Updates

End of the Log:
...END
2017-07-12 14:49:25 Install type is: Reinstall
2017-07-12 14:49:25 Creating logins...
2017-07-12 14:49:25 Fetching machine account info
2017-07-12 14:49:25 Found principal
2017-07-12 14:49:25 Disposing Connection
2017-07-12 14:49:25 Clearing Connection Pools
2017-07-12 14:49:25 System.SystemException: The trust relationship between this workstation and the primary domain failed.
at System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(IdentityReferenceCollection sourceSids, Boolean& someFailed)
at System.Security.Principal.SecurityIdentifier.Translate(IdentityReferenceCollection sourceSids, Type targetType, Boolean forceSuccess)
at System.Security.Principal.SecurityIdentifier.Translate(Type targetType)
at Microsoft.UpdateServices.Administration.ConfigureDB.GetMachineAccountInfo(Byte[]& binarySid, String& accountName)
at Microsoft.UpdateServices.Administration.ConfigureDB.Configure()
at Microsoft.UpdateServices.Administration.ConfigureDB.Run(String instanceName, Action`1 logWriter, Boolean contentLocal)
at Microsoft.UpdateServices.Administration.PostInstall.Run()
at Microsoft.UpdateServices.Administration.PostInstall.Execute(String[] arguments)