Skip to content

Commit d2b77cf

Browse files
committed
Always prefer dns on domain interface
Set low interface metric for domain interface. fixes clong#801
1 parent a4fd727 commit d2b77cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Vagrant/scripts/join-domain.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ $adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.I
1212
# Specify the DC as a WINS server to help with connectivity as well
1313
$adapters | ForEach-Object {if (!($_.Description).Contains("Hyper-V")) {$_.SetDNSServerSearchOrder($newDNSServers); $_.SetWINSServer($newDNSServers, "")}}
1414

15+
# Ensure dns preference on domain interface through higher interface metrics # fix #801
16+
Get-NetIPAddress | Where-Object { $_.IPAddress -match "192.168.56." } | Set-NetIPInterface -ifIndex { $_.InterfaceIndex } -InterfaceMetric 10
17+
1518
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Now join the domain..."
1619
$hostname = $(hostname)
1720
$user = "windomain.local\vagrant"

0 commit comments

Comments
 (0)