Generate configuration

Download the configuration generator

You can download the generator package from web page or command line.

  • From web:
    Go to the release page of this project and download dnsmasq-confgenerator-[VERSION].zip.

  • From command line:

      wget https://github.com/elespejo/dnsmasq/releases/download/[VERSION]/dnsmasq-confgenerator-[VERSION].zip
    

    e.g, download configuration generator of version 0.8.7

      wget https://github.com/elespejo/dnsmasq/releases/download/0.8.7/dnsmasq-confgenerator-0.8.7.zip
    

Unzip

unzip dnsmasq-confgenerator-[VERSION].zip

e.g,

unzip dnsmasq-confgenerator-0.8.7.zip
cd dnsmasq-confgenerator/

Generate configuration

  • Modify the conf-info
    The template conf-info is the dnsmasq-info.yml in unzipped confgenerator package.

      ls dnsmasq-confgenerator/
      confgenerator  dnsmasq-info.yml
    

    Modify the conf-info dnsmasq-info.yml. The meaning of each option see here. If you need to add more options to conf-info, just new a setting file and put it in dnsconf-dir

      # dnsmasq-info.yml
      dhcp-range: 192.168.0.5,192.168.0.150,12h
    
      dhcp-option: 6,192.168.0.1
    
      cache-size: 3000
    
      domain: powter
    
      local: /powter/
    
      dns-server:
        - ip: 1.1.1.1
          ports:
            start-port: 16350
            end-port: 16370
    
        - ip: 2.2.2.2
          ports:
            start-port: 16350
            end-port: 16370
    
      dnsconf-dir: /home/USER/dnsconf
    
  • Generate the configuration directory

      python -m confgenerator.cli -f [conf-info path] -d [configuration path]
    
    • [conf-info path] : the absolute path of conf-info file.
    • [configuration path] : the directory path of generated configuration. (This is optional, the default path is $PWD/dnsmasq)

      e.g,

      python -m confgenerator.cli -f $PWD/dnsmasq-info.yml
      

      The configurations are generated in $PWD/dnsmasq/.

results matching ""

    No results matching ""