Static DNS with DHCP in Windows 10

Page 1 of 2 12 LastLast

  1. Posts : 6
    Windows 10 Pro
       #1

    Static DNS with DHCP in Windows 10


    I'm running Windows 10 Pro 1909. I've just moved from Mac to Windows 10 and have really enjoyed it so far. The only small (and I do mean small) issue I'm having is the fact that I can't setup network locations the way I could on the Mac. In other words, I could setup location profiles that would allow me to set up network settings for specific locations. When I got there, I'd just switch my location to get those settings running in just a couple of seconds.

    What I ultimately need is the ability to set a Static DNS server based on the wireless network I'm attached to. If I'm at work, I want it to be static, but if I'm home or anywhere else, I want it to automatically supplied.

    I hope that makes sense. It's the only thing I haven't really managed to quite figure out. Otherwise, I'm loving the Dell XPS 15 7590 I picked up. It's a truly amazing piece of hardware.

    - - - Updated - - -

    As a quick clarification, I Need the DNS to be static while DHCP remains active.
      My Computer

  2. dmholt57's Avatar
    Posts : 14,903
    19043.985
       #2

    I'm setup with a static DNS and DHCP Auto... go into the ipv4 properties of the adapter and set the static address that you want and leave the DHCP set to auto


    Static DNS with DHCP in Windows 10-ipv4.pngStatic DNS with DHCP in Windows 10-staticdns.png
      My Computer


  3. Posts : 6
    Windows 10 Pro
    Thread Starter
       #3

    Yes, understand that and I know how to do that. My issue is being able to do it easily without having to go change that setting back and forth every time I go to work or come home from work. Apologies for not making that more clear.

    I'm hoping there is a trick like there is on Mac to make that switch quickly.

    On the Mac you click the Apple Menu and then you select location, and then you're off to the races.

    Anyway, I hope that clears things up, but perhaps it just muddies the water...
      My Computer

  4. TairikuOkami's Avatar
    Posts : 4,854
    Windows Home Dev 21xxx x64
       #4
      My Computer

  5. lx07's Avatar
    Posts : 5,479
    2004
       #5

    You could do this with the powershell Set-DnsClientServerAddress command. Make a script like this that sets DNS to some value if SSID is equal to your work SSID or else sets it to default and then clears the DNS cache.

    Code:
    $SSID = 'whatever'
    $Addresses = @('1.1.1.1','1.0.0.1','2606:4700:4700::1111','2606:4700:4700::1001')
    
    $NetConnectionProfiles = Get-NetConnectionProfile  
    ForEach ($NetConnectionProfile in $NetConnectionProfiles) {
      If ($NetConnectionProfile.Name -eq $SSID) { 
        Get-DnsClientServerAddress | ?{$_.InterfaceIndex -eq $NetConnectionProfile.InterfaceIndex} | Set-DnsClientServerAddress -Addresses $Addresses 
      } Else {
        Get-DnsClientServerAddress | ?{$_.InterfaceIndex -eq $NetConnectionProfile.InterfaceIndex} | Set-DnsClientServerAddress -ResetServerAddresses
      }
    }
    
    Clear-DNSClientCache
    Save it somewhere as SetDNS.ps1 and you can then call it from a shortcut or perhaps schedule it with Task Scheduler to run every time you logon.

    It needs to run with administrator privileges.
      My Computer

  6. Samuria's Avatar
    Posts : 6,195
    windows 10
       #6

    There is no point in what your trying to do if you set a fast universal DNS then there is no point at home getting a very poor DNS which by default is the very slow router
      My Computer


  7. Posts : 6
    Windows 10 Pro
    Thread Starter
       #7

    There is a point when my job has DNS locked down with layer 3 filtering that blocks all VPNs. Instead, they provide the admin staff with their own DNS that allows wider access to the internet for testing purposes.

    Therefore, I need to have a separate DNS for work than I do for home (which I set on my router to push out to my devices at home - and it's not the default ISP address).
      My Computer

  8. Barman58's Avatar
    Posts : 3,985
    Windows 10 Pro x64 2004 - 19041 - 264 XP/Vista/Win7/Win8.1 in VM for testing
       #8

    I would strongly suggest that you do not try to circumvent security systems employed in the workplace by your employer. Most IT systems rules of use will include strong sanctions, against those that attempt to circumvent access rules. I have seen a lot where it is an instant dismissal offence

    If you have a legitimate reason to have more access internal or external whilst at your workplace Most Systems admins will provide this, if asked
      My Computers


  9. Posts : 6
    Windows 10 Pro
    Thread Starter
       #9

    I'm not trying to circumvent the rules!

    Admins get more access to the web through this DNS, which has us log in once we're on the network before giving us access to the internet.

    I need to connect to that DNS to be able to do my job. Now I can manually change the DNS every day, but I'd rather set it up in such a way that I'm just able to click a menu or a button and have it switch from "Home" to "Work" to "Public" quickly and efficiently.
      My Computer

  10. Barman58's Avatar
    Posts : 3,985
    Windows 10 Pro x64 2004 - 19041 - 264 XP/Vista/Win7/Win8.1 in VM for testing
       #10

    Netsetman as suggested above should do all you want - First look does not show a way to automate it but if it's just a couple of times a day the tabbed interface should make things fairly quick - Obviously give the free version a go - There is a small fee for use in business if you find it works
      My Computers


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:18.
Find Us




Windows 10 Forums