Yay, it worked. Of course I'm stupid as always, because I was already setting the host name.
Here's full code for host/suffix change in vb.net:
Private Enum COMPUTER_NAME_FORMAT As Integer
ComputerNameNetBIOS = 0
ComputerNameDnsHostname = 1
ComputerNameDnsDomain = 2
ComputerNameDnsFullyQualified = 3
ComputerNamePhysicalNetBIOS = 4
ComputerNamePhysicalDnsHostname = 5
ComputerNamePhysicalDnsDomain = 6
ComputerNamePhysicalDnsFullyQualified = 7
End Enum
Public Const MAX_COMPUTERNAME_LENGTH As Int32 = 31
<DllImport("kernel32.dll", CharSet:=CharSet.Ansi, SetLastError:=True)> _
Private Shared Function SetComputerNameEx( _
ByVal NameType As COMPUTER_NAME_FORMAT, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpBuffer As String) As Integer
End Function
Public Function SetNewName(ByVal Computername As String, ByVal DNSSuffix As String) As Boolean
If NetworkSet.SetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNamePhysicalDnsHostname, _
Computername & Convert.ToChar(0)) = 0 Then
Throw New Win32Exception
End If
If NetworkSet.SetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNamePhysicalDnsDomain, _
DNSSuffix & Convert.ToChar(0)) = 0 Then
Throw New Win32Exception
End If
End Function