Re: [Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-03-05 Thread Petr Menšík
Any changes will not be read real time, only selected files like
--dhcp-hostsdir or --hostsdir. I think --hostsdir could be used for it,
reloading it without explicit SIGHUP. It will just watch for changes in
that directory. It would not allow to remove already served names
however. I think you can only add new names. I did not verify that
however myself.

Dne 2.3.2018 v 19:56 Steve Lloyd napsal(a):
> If I update an external conf file will dnsmasq read in the changes in
> real time or do I have to restart it?
> 
> On Fri, Mar 2, 2018 at 10:39 AM  > wrote:
> 
> On 03/02/2018 07:46 AM, Petr Menšík wrote:
> > and then generate your file any way you need. For example in bash
> >
> > echo "# Autogenerated file, do not edit by hand" >
> > /etc/dnsmasq.d/blocked.conf
> > for DOMAIN in 2o7.net  2mdm.net 
> >    do echo "address=/$DOMAIN/$MYIP" >> /etc/dnsmasq.d/blocked.conf
> > done
> 
> 
> even better would be...
> 
> 
> echo "# Autogenerated file, do not edit by hand" >
> /etc/dnsmasq.d/blocked.conf
> for DOMAIN in 2o7.net  2mdm.net 
> facebook.com  fbcdn.net 
> fbcdn.com  facebook.net 
>    do echo "server=/$DOMAIN/" >> /etc/dnsmasq.d/blocked.conf
> done
> 
> 
> so dnsmasq will return NXDOMAIN for blocked domains :evilBOFHgrin:
> 
> 
> --
>   NOTE: No off-list assistance is given without prior approval.
>         *Please keep mailing list traffic on the list unless*
>         *a signed and pre-paid contract is in effect with us.*
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> 
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com  PGP: 65C6C973

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-03-02 Thread Steve Lloyd
If I update an external conf file will dnsmasq read in the changes in real
time or do I have to restart it?

On Fri, Mar 2, 2018 at 10:39 AM  wrote:

> On 03/02/2018 07:46 AM, Petr Menšík wrote:
> > and then generate your file any way you need. For example in bash
> >
> > echo "# Autogenerated file, do not edit by hand" >
> > /etc/dnsmasq.d/blocked.conf
> > for DOMAIN in 2o7.net 2mdm.net
> >do echo "address=/$DOMAIN/$MYIP" >> /etc/dnsmasq.d/blocked.conf
> > done
>
>
> even better would be...
>
>
> echo "# Autogenerated file, do not edit by hand" >
> /etc/dnsmasq.d/blocked.conf
> for DOMAIN in 2o7.net 2mdm.net facebook.com fbcdn.net fbcdn.com
> facebook.net
>do echo "server=/$DOMAIN/" >> /etc/dnsmasq.d/blocked.conf
> done
>
>
> so dnsmasq will return NXDOMAIN for blocked domains :evilBOFHgrin:
>
>
> --
>   NOTE: No off-list assistance is given without prior approval.
> *Please keep mailing list traffic on the list unless*
> *a signed and pre-paid contract is in effect with us.*
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-03-02 Thread wkitty42

On 03/02/2018 07:46 AM, Petr Menšík wrote:

and then generate your file any way you need. For example in bash

echo "# Autogenerated file, do not edit by hand" >
/etc/dnsmasq.d/blocked.conf
for DOMAIN in 2o7.net 2mdm.net
   do echo "address=/$DOMAIN/$MYIP" >> /etc/dnsmasq.d/blocked.conf
done



even better would be...


echo "# Autogenerated file, do not edit by hand" > /etc/dnsmasq.d/blocked.conf
for DOMAIN in 2o7.net 2mdm.net facebook.com fbcdn.net fbcdn.com facebook.net
  do echo "server=/$DOMAIN/" >> /etc/dnsmasq.d/blocked.conf
done


so dnsmasq will return NXDOMAIN for blocked domains :evilBOFHgrin:


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list unless*
   *a signed and pre-paid contract is in effect with us.*

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-03-02 Thread Petr Menšík
You can use any script to generate those addresses into separate file.
Dnsmasq is very low overhead server without real built-in scripting for
these things. It already contains lua interpreter, but I think such
features should be left to external scripts instead.

You can already use:
conf-dir=/etc/dnsmasq.d

and then generate your file any way you need. For example in bash

echo "# Autogenerated file, do not edit by hand" >
/etc/dnsmasq.d/blocked.conf
for DOMAIN in 2o7.net 2mdm.net
  do echo "address=/$DOMAIN/$MYIP" >> /etc/dnsmasq.d/blocked.conf
done

I think this is simple enough for any reasonable use. Why should dnsmasq
have it built-in?

Dne 20.2.2018 v 08:44 M. Buecher napsal(a):
> On 2018-02-19 21:28, Steve Lloyd wrote:
> 
>> Is it possilbe to set a variable and then use it as follows?  or is
>> there a way to set and use a variable in the conf file for address
>> entries?
>>  
>> myip=10.0.1.6
>> address=/2o7.net/$myip 
>> address=/2mdm.net/$myip 
>>  
>> instead of 
>> address=/2o7.net/10.0.1.6 
>> address=/2mdm.net/10.0.1.6 
>>  
>  
> +1 for such a feature as this would easy my playground setup a lot, in
> my case:
> dhcp-host=aa:bb:cc:dd:ee:ff,${NETWORK4NET1PREFIX}.27,[${NETWORK6ULA1PREFIX}::1b],my-host
>  
> 
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 

-- 
Petr Menšík
Software Engineer
Red Hat, http://www.redhat.com/
email: pemen...@redhat.com  PGP: 65C6C973

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-02-20 Thread M. Buecher
On 2018-02-19 21:28, Steve Lloyd wrote:

> Is it possilbe to set a variable and then use it as follows?  or is there a 
> way to set and use a variable in the conf file for address entries? 
> 
> myip=10.0.1.6 
> address=/2o7.net/$myip [1] 
> address=/2mdm.net/$myip [2] 
> 
> instead of  
> address=/2o7.net/10.0.1.6 [3] 
> address=/2mdm.net/10.0.1.6 [4]

+1 for such a feature as this would easy my playground setup a lot, in
my case: 
dhcp-host=aa:bb:cc:dd:ee:ff,${NETWORK4NET1PREFIX}.27,[${NETWORK6ULA1PREFIX}::1b],my-host

  

Links:
--
[1] http://2o7.net/$myip
[2] http://2mdm.net/$myip
[3] http://2o7.net/10.0.1.6
[4] http://2mdm.net/10.0.1.6___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Using a variable in the address option in dnsmasq.conf

2018-02-19 Thread Steve Lloyd
Is it possilbe to set a variable and then use it as follows?  or is there a
way to set and use a variable in the conf file for address entries?

myip=10.0.1.6
address=/2o7.net/$myip
address=/2mdm.net/$myip

instead of
address=/2o7.net/10.0.1.6
address=/2mdm.net/10.0.1.6
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss