Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
382a3d3b
Commit
382a3d3b
authored
Jun 18, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unbound: move get_dns_servers()
parent
0b486cd1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
20 deletions
+21
-20
pfsense-utils.inc
src/etc/inc/pfsense-utils.inc
+0
-20
unbound.inc
src/etc/inc/unbound.inc
+21
-0
No files found.
src/etc/inc/pfsense-utils.inc
View file @
382a3d3b
...
...
@@ -51,26 +51,6 @@ function is_private_ip($iptocheck)
return
$isprivate
;
}
/****f* legacy/get_dns_servers
* NAME
* get_dns_servers - get system dns servers
* INPUTS
* $dns_servers - an array of the dns servers
* RESULT
* null
******/
function
get_dns_servers
()
{
$dns_servers
=
array
();
$dns_s
=
file
(
"/etc/resolv.conf"
,
FILE_IGNORE_NEW_LINES
|
FILE_SKIP_EMPTY_LINES
);
foreach
(
$dns_s
as
$dns
)
{
$matches
=
""
;
if
(
preg_match
(
"/nameserver (.*)/"
,
$dns
,
$matches
))
{
$dns_servers
[]
=
$matches
[
1
];
}
}
return
array_unique
(
$dns_servers
);
}
/*
* get_carp_interface_status($carpinterface): returns the status of a carp ip
*/
...
...
src/etc/inc/unbound.inc
View file @
382a3d3b
...
...
@@ -3,6 +3,7 @@
/*
Copyright (C) 2015 Manuel Faux <mfaux@conf.at>
Copyright (C) 2014 Warren Baker <warren@decoy.co.za>
Copyright (C) 2004-2007 Scott Ullrich <sullrich@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
...
...
@@ -27,6 +28,26 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/****f* legacy/get_dns_servers
* NAME
* get_dns_servers - get system dns servers
* INPUTS
* $dns_servers - an array of the dns servers
* RESULT
* null
******/
function
get_dns_servers
()
{
$dns_servers
=
array
();
$dns_s
=
file
(
"/etc/resolv.conf"
,
FILE_IGNORE_NEW_LINES
|
FILE_SKIP_EMPTY_LINES
);
foreach
(
$dns_s
as
$dns
)
{
$matches
=
""
;
if
(
preg_match
(
"/nameserver (.*)/"
,
$dns
,
$matches
))
{
$dns_servers
[]
=
$matches
[
1
];
}
}
return
array_unique
(
$dns_servers
);
}
/* Optimize Unbound for environment */
function
unbound_optimization
()
{
global
$config
;
...
...
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