Modify

Opened 9 years ago

Closed 8 years ago

Last modified 4 years ago

#5017 closed enhancement (obsolete)

Patch to dnsmasq: remove duplicated option local and add list address

Reported by: buildster Owned by: cshore
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

The introduction of list "server" made the "local" option obsolete. The two perform the same functionality, yet the former user interface is a superset of the latter. Thus, with the "local" removal, the default config is still kept the same using list "server". From dnsmasq's man page:

       -S, --local, --server=[/[<domain>]/[domain/]][<ipaddr>[#<port>][@<source>[#<port>]]]
              Specify IP address of upstream  severs  directly.  Setting  this
              flag does not suppress reading of /etc/resolv.conf, use -R to do
              that. If one or more optional domains are given, that server  is
              used  only for those domains and they are queried only using the
              specified server. This is intended for private  nameservers:  if
              you  have a nameserver on your network which deals with names of
              the form xxx.internal.thekelleys.org.uk at 192.168.1.1 then giv-
              ing   the  flag  -S /internal.thekelleys.org.uk/192.168.1.1 will
              send all queries  for  internal  machines  to  that  nameserver,
              everything  else  will go to the servers in /etc/resolv.conf. An
              empty domain  specification,  //  has  the  special  meaning  of
              "unqualified  names  only"  ie names without any dots in them. A
              non-standard port may be specified as part  of  the  IP  address
              using  a  #  character.   More than one -S flag is allowed, with
              repeated domain or ipaddr parts as required.

Also, add list "address" (piggyback with the code of list "server").

       -A, --address=/<domain>/[domain/]<ipaddr>
              Specify  an  IP  address  to  return  for  any host in the given
              domains.  Queries in the domains are never forwarded and  always
              replied  to  with  the specified IP address which may be IPv4 or
              IPv6. To give both IPv4 and IPv6 addresses  for  a  domain,  use
              repeated  -A  flags.  Note that /etc/hosts and DHCP leases over-
              ride this for individual names. A common use of this is to redi-
              rect  the  entire  doubleclick.net domain to some friendly local
              web server to avoid banner ads. The domain  specification  works
              in  the  same  was as for --server, with the additional facility
              that /#/ matches  any  domain.  Thus  --address=/#/1.2.3.4  will
              always return 1.2.3.4 for any query not answered from /etc/hosts
              or DHCP and not sent to an upstream nameserver by  a  more  spe-
              cific --server directive.

Attachments (2)

remove_local_and_add_address.patch (1.6 KB) - added by buildster 9 years ago.
remove_local_and_add_address2.patch (1.7 KB) - added by buildster 9 years ago.
Please find attached remove_local_and_add_address2.patch, which integrates with list "interface" introduced in r15613.

Download all attachments as: .zip

Change History (9)

Changed 9 years ago by buildster

Changed 9 years ago by buildster

Please find attached remove_local_and_add_address2.patch, which integrates with list "interface" introduced in r15613.

comment:1 Changed 9 years ago by anonymous

Yes, the address option is definitely missing, I'm also looking forward to have it upstream in bleeding edge.

But I just have a short question, is the list-type (instead of option) uci conform? I don't find a way to easily modify that parameter with uci set for example. If it's not conforming the uci syntax, I suggest to change it the way that pasting multiple addresses or servers as one string to the option-type is allowed, for example like " option address '/whatever.domain/192.168.123.45 /whatever.other-domain/192.168.234.56' "

comment:2 Changed 9 years ago by buildster

Re: is the list-type (instead of option) uci conform?
A good question. I just tried in a build of r15060. Though not very nicely, uci supports the list type. To add an entry (better than the option type),

uci add_list <config>.<section>.<option>=<string>

To delete,

uci delete <config>[.<section[.<option>]]

will delete the entire list (no worse than the option type)

comment:3 Changed 9 years ago by anonymous

Thanks for the clarification, buildster. The second patch works perfectly fine for me now and I'm looking forward to having it in trunk :) (otherwise it would be great if you could send them the patch by email according to the "how to submit patches", buildster)

comment:4 Changed 8 years ago by cshore

  • Owner changed from developers to cshore
  • Status changed from new to assigned

comment:5 Changed 8 years ago by cshore

  • Status changed from assigned to accepted

comment:6 Changed 8 years ago by cshore

  • Resolution set to obsolete
  • Status changed from accepted to closed

This has been rendered obsolete...that is dnsmasq creates this entries with the server options now.

comment:7 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.