Jeff Sloyer
Jeff Sloyer

Reputation: 4964

Windows Equivalent on dnsmasq in Appveyor

What do you all recommend using as a replacement for dnsmasq on Windows on AppVeyor? Do you have any installation instructions for a replacement or an example job I can look at?

Upvotes: 2

Views: 2286

Answers (1)

Ilya Finkelsheyn
Ilya Finkelsheyn

Reputation: 2881

I believe it is pretty easy to script installation (using Install-WindowsFeature) and configuration of standard MS DNS and DHCP on Appveyor VM and configure them with PowerShell.

Here are useful PowerShell commands:

https://technet.microsoft.com/en-us/library/jj590751(v=wps.630).aspx

https://technet.microsoft.com/en-us/library/jj649850.aspx

Here is sample install section for Appveyor.yml:

install:
- ps: |

    Install-WindowsFeature -Name DNS -IncludeManagementTools -WarningAction SilentlyContinue

    Install-WindowsFeature -Name DHCP -IncludeManagementTools -WarningAction SilentlyContinue

    Add-DnsServerPrimaryZone -Name foo.bar -ZoneFile foo.bar.dns

    Add-DhcpServerv4Scope -Name TestScope -StartRange 192.168.1.100 -EndRange 192.168.1.110 -SubnetMask 255.255.255.0

    $ip = (Get-NetIPAddress -AddressFamily IPv4 | Where-Object {$_.InterfaceAlias -like '*ethernet*'}).IPAddress

    Set-DHCPServerv4OptionValue -DnsDomain foo.bar -DnsServer $ip

However, I am not sure I fully understand the scenario. What machines are going to be clients of those services? Appveyor build is being executed on the single VM, which is behind the NAT and it is not accessible from public Internet. Or it will be some pieces of your software who will connect to local machine’s DNS/DHCP server, acquire private IP and register some name?

Also please note that you can configure hosts file, which may be simpler solution for your problem.

Thank you,

Ilya.

Upvotes: 1

Related Questions