Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
a1d973f9
Commit
a1d973f9
authored
Dec 22, 2016
by
Simon Kelley
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow multiple CNAMEs in a single --cname= option.
parent
0682b779
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
man/dnsmasq.8
man/dnsmasq.8
+4
-2
src/option.c
src/option.c
+19
-12
No files found.
man/dnsmasq.8
View file @
a1d973f9
...
@@ -581,7 +581,7 @@ Return a PTR DNS record.
...
@@ -581,7 +581,7 @@ Return a PTR DNS record.
.B --naptr-record=<name>,<order>,<preference>,<flags>,<service>,<regexp>[,<replacement>]
.B --naptr-record=<name>,<order>,<preference>,<flags>,<service>,<regexp>[,<replacement>]
Return an NAPTR DNS record, as specified in RFC3403.
Return an NAPTR DNS record, as specified in RFC3403.
.TP
.TP
.B --cname=<cname>,<target>[,<TTL>]
.B --cname=<cname>,
[<cname>,]
<target>[,<TTL>]
Return a CNAME record which indicates that <cname> is really
Return a CNAME record which indicates that <cname> is really
<target>. There are significant limitations on the target; it must be a
<target>. There are significant limitations on the target; it must be a
DNS name which is known to dnsmasq from /etc/hosts (or additional
DNS name which is known to dnsmasq from /etc/hosts (or additional
...
@@ -589,7 +589,9 @@ hosts files), from DHCP, from --interface-name or from another
...
@@ -589,7 +589,9 @@ hosts files), from DHCP, from --interface-name or from another
.B --cname.
.B --cname.
If the target does not satisfy this
If the target does not satisfy this
criteria, the whole cname is ignored. The cname must be unique, but it
criteria, the whole cname is ignored. The cname must be unique, but it
is permissable to have more than one cname pointing to the same target.
is permissable to have more than one cname pointing to the same target. Indeed
it's possible to declare multiple cnames to a target in a single line, like so:
.B --cname=cname1,cname2,target
If the time-to-live is given, it overrides the default, which is zero
If the time-to-live is given, it overrides the default, which is zero
or the value of -local-ttl. The value is a positive integer and gives
or the value of -local-ttl. The value is a positive integer and gives
...
...
src/option.c
View file @
a1d973f9
...
@@ -3728,22 +3728,27 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -3728,22 +3728,27 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
case
LOPT_CNAME
:
/* --cname */
case
LOPT_CNAME
:
/* --cname */
{
{
struct
cname
*
new
;
struct
cname
*
new
;
char
*
alias
,
*
target
,
*
ttls
;
char
*
alias
,
*
target
,
*
last
,
*
pen
;
int
ttl
=
-
1
;
int
ttl
=
-
1
;
if
(
!
(
comma
=
split
(
arg
)))
for
(
last
=
pen
=
NULL
,
comma
=
arg
;
comma
;
comma
=
split
(
comma
))
ret_err
(
gen_err
);
{
pen
=
last
;
if
((
ttls
=
split
(
comma
))
&&
!
atoi_check
(
ttls
,
&
ttl
))
last
=
comma
;
ret_err
(
_
(
"bad TTL"
));
}
alias
=
canonicalise_opt
(
arg
);
if
(
!
pen
)
target
=
canonicalise_opt
(
comma
);
if
(
!
alias
||
!
target
)
ret_err
(
_
(
"bad CNAME"
));
ret_err
(
_
(
"bad CNAME"
));
else
if
(
pen
!=
arg
&&
atoi_check
(
last
,
&
ttl
))
last
=
pen
;
target
=
canonicalise_opt
(
last
);
while
(
arg
!=
last
)
{
{
alias
=
canonicalise_opt
(
arg
);
for
(
new
=
daemon
->
cnames
;
new
;
new
=
new
->
next
)
for
(
new
=
daemon
->
cnames
;
new
;
new
=
new
->
next
)
if
(
hostname_isequal
(
new
->
alias
,
arg
))
if
(
hostname_isequal
(
new
->
alias
,
arg
))
ret_err
(
_
(
"duplicate CNAME"
));
ret_err
(
_
(
"duplicate CNAME"
));
...
@@ -3753,6 +3758,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
...
@@ -3753,6 +3758,8 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
new
->
alias
=
alias
;
new
->
alias
=
alias
;
new
->
target
=
target
;
new
->
target
=
target
;
new
->
ttl
=
ttl
;
new
->
ttl
=
ttl
;
arg
+=
strlen
(
arg
)
+
1
;
}
}
break
;
break
;
...
...
神楽坂玲奈
@zh99998
mentioned in commit
30858e3b
·
Dec 13, 2020
mentioned in commit
30858e3b
mentioned in commit 30858e3b9b12500825a5dc4cd67902c3201c1b25
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment