Current time: 11-06-2024, 10:48 AM Hello There, Guest! (LoginRegister)


Post Reply 
Custom DNS server
Author Message
miloszes Offline
Newbie
*

Posts: 8
Joined: Feb 2010
Reputation: 0
Post: #1
Custom DNS server
Hi all.

My client requires me to handle his dns. He would like to transfer a domain to the server at which the ISPCP is installed.

1) does ISPCP handles DNS ?
2) can I configure a MX record to handle different gmail?
3) is it safe?

Sorry if that questions are silly, but I'm just a beginner in the area and didn't find satisfy answers via google.


Kind Regards,
MiloszeS
04-15-2010 05:49 AM
Find all posts by this user Quote this message in a reply
can79 Offline


Posts: 4
Joined: Apr 2010
Reputation: 0
Post: #2
RE: Custom DNS server
yes, it would be better that ispCP like ISPConfig all dns records can change.
Now I do with webmin.

anyone know? or the newer versions of ispCP more dns options can change?
04-23-2010 09:01 PM
Find all posts by this user Quote this message in a reply
aseques Offline
Member
*****
Dev Team

Posts: 330
Joined: May 2008
Reputation: 4
Post: #3
RE: Custom DNS server
It's up to you, it can be done if you comment some lines on the dns template (db_e.tpl), but you will have to recreate them in the database for EVERY domain you have.
04-23-2010 11:18 PM
Find all posts by this user Quote this message in a reply
can79 Offline


Posts: 4
Joined: Apr 2010
Reputation: 0
Post: #4
RE: Custom DNS server
(04-23-2010 11:18 PM)aseques Wrote:  It's up to you, it can be done if you comment some lines on the dns template (db_e.tpl), but you will have to recreate them in the database for EVERY domain you have.

it's not exactly what we want.
I actually (db_e.tpl) edited. but with GUI can i not txt or ns records of sfp records find.

i think ispcp gui with the following options would be better
- Multi-templates (when creating a domain template simply a choice option) (eg Template1 = google apps, template2 = local mail server, template3 = no template mail only web etc.)
- In GUI dns records more options.
(This post was last modified: 04-24-2010 01:02 AM by can79.)
04-24-2010 12:59 AM
Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #5
RE: Custom DNS server
(04-24-2010 12:59 AM)can79 Wrote:  i think ispcp gui with the following options would be better
- Multi-templates (when creating a domain template simply a choice option) (eg Template1 = google apps, template2 = local mail server, template3 = no template mail only web etc.)
- In GUI dns records more options.

Go on. You are free to develop it and send it to the dev Team Wink
04-24-2010 01:14 AM
Visit this user's website Find all posts by this user Quote this message in a reply
can79 Offline


Posts: 4
Joined: Apr 2010
Reputation: 0
Post: #6
RE: Custom DNS server
I have a solution for custom NS records. (based on ispCP 1.05)
I think dev team can improve.


NOTE.
After you customize for each domain you have to create A records and NS records
So there is no longer automatically ns records created.
advantage is that you can yourself edit ns records for each domain.

This will only a tip for dev team.
I do not support on pm. and you are responsible for errors.
before you start. make backup

it works as follows;

Change /etc/ispcp/bind/parts/db_e.tpl and /etc/ispcp/bind/parts/db_master_e.tpl as follows


Code:
$TTL 12H
$ORIGIN {DMN_NAME}.
@               IN              SOA             ns1.{DMN_NAME}. postmaster.{DMN_NAME}. (
; dmn [{DMN_NAME}] timestamp entry BEGIN.
                {TIMESTAMP}     ; Serial
; dmn [{DMN_NAME}] timestamp entry END.
                8H              ; Refresh
                30M             ; Retry
                4W              ; Expire
                3H              ; Minimum TTL
)

{DMN_NAME}.     IN              A               {DMN_IP}
localhost       IN              A               127.0.0.1

; CNAME for VHCS compatibility
ns              IN              CNAME           ns1
; CNAME for mail transfer
; CNAME for web transfer
; sub [{SUB_NAME}] entry BEGIN.
; sub [{SUB_NAME}] entry END.

; dns [{MANUAL_DNS_ID}] entry BEGIN.
; dns [{MANUAL_DNS_ID}] entry END.
Change in /var/www/ispcp/gui/client/dns_edit.php following lines.

next line
Code:
$DNS_allowed_types = array('A','AAAA','SRV','CNAME','MX');

to
Code:
$DNS_allowed_types = array('A','NS','AAAA','SRV','CNAME','MX');

next

Code:
function decode_zone_data($data) {
        $address = $addressv6 = $srv_name = $srv_proto = $cname = $txt = $name = '';
        $srv_TTL = $srv_prio = $srv_weight = $srv_host = $srv_port = '';

        if (is_array($data)) {
                $name = $data['domain_dns'];
                switch ($data['domain_type']) {
                        case 'A':
                                $address = $data['domain_text'];
                                break;
                        case 'AAAA':
                                $addressv6 = $data['domain_text'];
                                break;
                        case 'CNAME':
                                $cname = $data['domain_text'];
                                break;
                        case 'SRV':
                                $name = '';
                                if (preg_match('~_([^\.]+)\._([^\s]+)[\s]+([\d]+)~', $data['domain_dns'], $srv)) {
                                        $srv_name = $srv[1];
                                        $srv_proto = $srv[2];
                                        $srv_TTL = $srv[3];
                                }
                                if (preg_match('~([\d]+)[\s]+([\d]+)[\s]+([\d]+)[\s]+([^\s]+)+~', $data['domain_text'], $srv)) {
                                        $srv_prio = $srv[1];
                                        $srv_weight = $srv[2];
                                        $srv_port = $srv[3];
                                        $srv_host = $srv[4];
                                }
                                break;
                        case 'MX':
                                $name = '';
                                if (preg_match('~([\d]+)[\s]+([^\s]+)+~', $data['domain_text'], $srv)) {
                                        $srv_prio = $srv[1];
                                        $srv_host = $srv[2];
                                }
                                break;
                        default:
                                $txt = $data['domain_text'];
                }
        }
        return array(
                $name, $addressns, $addressv6, $srv_name, $srv_proto, $srv_TTL, $srv_prio,
                $srv_weight, $srv_host, $srv_port, $cname, $txt
        );
to

Code:
function decode_zone_data($data) {
        $address = $addressns = $addressv6 = $srv_name = $srv_proto = $cname = $txt = $name = '';
        $srv_TTL = $srv_prio = $srv_weight = $srv_host = $srv_port = '';

        if (is_array($data)) {
                $name = $data['domain_dns'];
                switch ($data['domain_type']) {
                        case 'A':
                                $address = $data['domain_text'];
                                break;
                        case 'NS':
//                                $cname = $data['domain_text'];
                                $addressns = $data['domain_text'];
                                break;
                        case 'AAAA':
                                $addressv6 = $data['domain_text'];
                                break;
                        case 'CNAME':
                                $cname = $data['domain_text'];
                                break;
                        case 'SRV':
                                $name = '';
                                if (preg_match('~_([^\.]+)\._([^\s]+)[\s]+([\d]+)~', $data['domain_dns'], $srv)) {
                                        $srv_name = $srv[1];
                                        $srv_proto = $srv[2];
                                        $srv_TTL = $srv[3];
                                }
                                if (preg_match('~([\d]+)[\s]+([\d]+)[\s]+([\d]+)[\s]+([^\s]+)+~', $data['domain_text'], $srv)) {
                                        $srv_prio = $srv[1];
                                        $srv_weight = $srv[2];
                                        $srv_port = $srv[3];
                                        $srv_host = $srv[4];
                                }
                                break;
                        case 'MX':
                                $name = '';
                                if (preg_match('~([\d]+)[\s]+([^\s]+)+~', $data['domain_text'], $srv)) {
                                        $srv_prio = $srv[1];
                                        $srv_host = $srv[2];
                                }
                                break;
                        default:
                                $txt = $data['domain_text'];
                }
        }
        return array(
                $name, $address, $addressns, $addressv6, $srv_name, $srv_proto, $srv_TTL, $srv_prio,
                $srv_weight, $srv_host, $srv_port, $cname, $txt
        );

next

Code:
switch ($_POST['type']) {
                case 'CNAME':
                        if (!validate_CNAME($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_cname'];
                        $_dns = $_POST['dns_name'];
                        break;
                case 'A':
                        if (!validate_A($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        if (!check_CNAME_conflict($_POST['dns_name'].'.'.$record_domain, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_A_address'];
                        $_dns = $_POST['dns_name'];
                        break;
                case 'AAAA':
                        if (!validate_AAAA($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        if (!check_CNAME_conflict($_POST['dns_name'].'.'.$record_domain, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_AAAA_address'];
                        $_dns = $_POST['dns_name'];
                        break;

to

Code:
switch ($_POST['type']) {
                case 'CNAME':
                        if (!validate_CNAME($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_cname'];
                        $_dns = $_POST['dns_name'];
                        break;
                case 'A':
                        if (!validate_A($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_A_address'];
                        $_dns = $_POST['dns_name'];
                        break;
                case 'NS':
                        if (!validate_NS($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_NS_addressns'];
                        $_dns = $_POST['dns_name'];
                        break;
                case 'AAAA':
                        if (!validate_AAAA($_POST, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        if (!check_CNAME_conflict($_POST['dns_name'].'.'.$record_domain, $err))
                                $ed_error = sprintf(tr('Cannot validate %s record. Reason \'%s\'.'), $_POST['type'], $err);
                        $_text = $_POST['dns_AAAA_address'];
                        $_dns = $_POST['dns_name'];
                        break;
next
Code:
list(
                $name,
                $address,
                $addressv6,
                $srv_name,
                $srv_proto,
                $srv_ttl,
                $srv_prio,
                $srv_weight,
                $srv_host,
                $srv_port,
                $cname,
                $plain
                ) = decode_zone_data($data);
to

Code:
list(
                $name,
                $address,
                $addressns,
                $addressv6,
                $srv_name,
                $srv_proto,
                $srv_ttl,
                $srv_prio,
                $srv_weight,
                $srv_host,
                $srv_port,
                $cname,
                $plain
                ) = decode_zone_data($data);
next


Code:
$tpl->assign(
                array(
                        'SELECT_DNS_TYPE'                       => $dns_type,
                        'SELECT_DNS_CLASS'                      => $dns_class,
                        'DNS_NAME'                                      => $name,
                        'DNS_ADDRESS'                           => tryPost('dns_A_address', $address),
                        'DNS_ADDRESS_V6'                        => tryPost('dns_AAAA_address', $addressv6),
                        'SELECT_DNS_SRV_PROTOCOL'       => create_options(array('tcp','udp'), tryPost('srv_proto', $srv_proto)),
                        'DNS_SRV_NAME'                          => tryPost('dns_srv_name', $srv_name),
                        'DNS_SRV_TTL'                           => tryPost('dns_srv_ttl', $srv_ttl),
                        'DNS_SRV_PRIO'                          => tryPost('dns_srv_prio', $srv_prio),
                        'DNS_SRV_WEIGHT'                        => tryPost('dns_srv_weight', $srv_weight),
                        'DNS_SRV_HOST'                          => tryPost('dns_srv_host', $srv_host),
                        'DNS_SRV_PORT'                          => tryPost('dns_srv_port', $srv_port),
                        'DNS_CNAME'                                     => tryPost('dns_cname', $cname),
                        'DNS_PLAIN'                                     => tryPost('dns_plain_data', $plain),
                        'ID'                                            => $edit_id
                )
        );
to

Code:
$tpl->assign(
                array(
                        'SELECT_DNS_TYPE'                       => $dns_type,
                        'SELECT_DNS_CLASS'                      => $dns_class,
                        'DNS_NAME'                                      => $name,
                        'DNS_ADDRESS'                           => tryPost('dns_A_address', $address),
                        'DNS_NS'                                        => tryPost('dns_NS_address', $addressns),
                        'DNS_ADDRESS_V6'                        => tryPost('dns_AAAA_address', $addressv6),
                        'SELECT_DNS_SRV_PROTOCOL'       => create_options(array('tcp','udp'), tryPost('srv_proto', $srv_proto)),
                        'DNS_SRV_NAME'                          => tryPost('dns_srv_name', $srv_name),
                        'DNS_SRV_TTL'                           => tryPost('dns_srv_ttl', $srv_ttl),
                        'DNS_SRV_PRIO'                          => tryPost('dns_srv_prio', $srv_prio),
                        'DNS_SRV_WEIGHT'                        => tryPost('dns_srv_weight', $srv_weight),
                        'DNS_SRV_HOST'                          => tryPost('dns_srv_host', $srv_host),
                        'DNS_SRV_PORT'                          => tryPost('dns_srv_port', $srv_port),
                        'DNS_CNAME'                                     => tryPost('dns_cname', $cname),
                        'DNS_PLAIN'                                     => tryPost('dns_plain_data', $plain),
                        'ID'                                            => $edit_id
                )
        );
next


Code:
$tpl->assign(
        array(
                'TR_MODIFY'                             => tr('Modify'),
                'TR_CANCEL'                             => tr('Cancel'),
                'TR_ADD'                                => tr('Add'),
                'TR_DOMAIN'                             => tr('Domain'),
                'TR_EDIT_DNS'                   => ($add_mode) ? tr("Add DNS zone's record (EXPERIMENTAL)") : tr("Edit DNS zone's record (EXPERIMENTAL)"),
                'TR_DNS'                                => tr("DNS zone's records"),
                'TR_DNS_NAME'                   => tr('Name'),
                'TR_DNS_CLASS'                  => tr('Class'),
                'TR_DNS_TYPE'                   => tr('Type'),
                'TR_DNS_SRV_NAME'               => tr('Service name'),
                'TR_DNS_IP_ADDRESS'             => tr('IP address'),
                'TR_DNS_IP_ADDRESS_V6'  => tr('IPv6 address'),
                'TR_DNS_SRV_PROTOCOL'   => tr('Service protocol'),
                'TR_DNS_SRV_TTL'                => tr('TTL'),
                'TR_DNS_SRV_PRIO'               => tr('Priority'),
                'TR_DNS_SRV_WEIGHT'             => tr('Relative weight for records with the same priority'),
                'TR_DNS_SRV_HOST'               => tr('Target host'),
                'TR_DNS_SRV_PORT'               => tr('Target port'),
                'TR_DNS_CNAME'                  => tr('Canonical name'),
                'TR_DNS_PLAIN'                  => tr('Plain record data'),
                'TR_MANAGE_DOMAIN_DNS'  => tr("DNS zone's records (EXPERIMENTAL)")
        )
);
to

Code:
$tpl->assign(
        array(
                'TR_MODIFY'                             => tr('Modify'),
                'TR_CANCEL'                             => tr('Cancel'),
                'TR_ADD'                                => tr('Add'),
                'TR_DOMAIN'                             => tr('Domain'),
                'TR_EDIT_DNS'                   => ($add_mode) ? tr("Add DNS zone's record (EXPERIMENTAL)") : tr("Edit DNS zone's record (EXPERIMENTAL)"),
                'TR_DNS'                                => tr("DNS zone's records"),
                'TR_DNS_NAME'                   => tr('Name'),
                'TR_DNS_CLASS'                  => tr('Class'),
                'TR_DNS_TYPE'                   => tr('Type'),
                'TR_DNS_SRV_NAME'               => tr('Service name'),
                'TR_DNS_IP_ADDRESS'             => tr('IP address (Absolute names must end with a .)'),
                'TR_DNS_NS'                     => tr('NS address (Absolute names must end with a .)'),
                'TR_DNS_IP_ADDRESS_V6'  => tr('IPv6 address'),
                'TR_DNS_SRV_PROTOCOL'   => tr('Service protocol'),
                'TR_DNS_SRV_TTL'                => tr('TTL'),
                'TR_DNS_SRV_PRIO'               => tr('Priority'),
                'TR_DNS_SRV_WEIGHT'             => tr('Relative weight for records with the same priority'),
                'TR_DNS_SRV_HOST'               => tr('Target host'),
                'TR_DNS_SRV_PORT'               => tr('Target port'),
                'TR_DNS_CNAME'                  => tr('Canonical name'),
                'TR_DNS_PLAIN'                  => tr('Plain record data'),
                'TR_MANAGE_DOMAIN_DNS'  => tr("DNS zone's records (EXPERIMENTAL)")
        )
);
Change in /var/www/ispcp/gui/themes/omega_original/client/dns_edit.tpl following lines.

next

Code:
function dns_show_rows(arr_show) {
                var arr_possible = new Array('name', 'ip_address', 'ip_address_v6',
to


Code:
function dns_show_rows(arr_show) {
                var arr_possible = new Array('name', 'ip_address', 'addressns', 'ip_address_v6',

next

Code:
function dns_type_changed(value) {
                if (value == 'A') {
                        dns_show_rows(new Array('name', 'ip_address'));
                } else if (value == 'NS') {
                        dns_show_rows(new Array('name', 'addressns'));
                } else if (value == 'AAAA') {
                        dns_show_rows(new Array('name', 'ip_address_v6'));
                } else if (value == 'SRV') {
                        dns_show_rows(new Array('srv_name', 'srv_protocol', 'srv_ttl',
                                'srv_prio', 'srv_weight', 'srv_host', 'srv_port'));
                } else if (value == 'CNAME') {
                        dns_show_rows(new Array('name', 'cname'));
                } else if (value == 'MX') {
                        dns_show_rows(new Array('srv_prio', 'srv_host'));
                }
        }

to

Code:
function dns_type_changed(value) {
                if (value == 'A') {
                        dns_show_rows(new Array('name', 'ip_address'));
                } else if (value == 'NS') {
                        dns_show_rows(new Array('name', 'addressns'));
                } else if (value == 'AAAA') {
                        dns_show_rows(new Array('name', 'ip_address_v6'));
                } else if (value == 'SRV') {
                        dns_show_rows(new Array('srv_name', 'srv_protocol', 'srv_ttl',
                                'srv_prio', 'srv_weight', 'srv_host', 'srv_port'));
                } else if (value == 'CNAME') {
                        dns_show_rows(new Array('name', 'cname'));
                } else if (value == 'MX') {
                        dns_show_rows(new Array('srv_prio', 'srv_host'));
                }
        }



next


Code:
<tr id="tr_dns_ip_address">
                                                                                                <td width="25">&nbsp;</td>
                                                                                                <td width="200" class="content2">{TR_DNS_IP_ADDRESS}</td>
                                                                                                <td class="content"><input type="text" onkeypress="return filterChars(event, IPADDRESS);" name="dns_A_address" value="{DNS_ADDRESS}" /></td>
                                                                                        </tr>
                                                                                        <tr id="tr_dns_ip_address_v6">
                                                                                                <td width="25">&nbsp;</td>
                                                                                                <td width="200" class="content2">{TR_DNS_IP_ADDRESS_V6}</td>
                                                                                                <td class="content"><input type="text" onkeypress="return filterChars(event, IPv6ADDRESS);" name="dns_AAAA_address" value="{DNS_ADDRESS_V6}" /></td>

to


Code:
<tr id="tr_dns_ip_address">
                                                                                                <td width="25">&nbsp;</td>
                                                                                                <td width="200" class="content2">{TR_DNS_IP_ADDRESS}</td>
                                                                                                <td class="content"><input type="text" name="dns_A_address" value="{DNS_ADDRESS}" /></td>
                                                                                        </tr>
                                                                                        <tr id="tr_dns_addressns">
                                                                                                <td width="25">&nbsp;</td>
                                                                                                <td width="200" class="content2">{TR_DNS_NS}</td>
                                                                                                <td class="content"><input type="text" name="dns_NS_addressns" value="{DNS_ADDRESS}" /></td>
                                                                                        </tr>


yup I can now manage manual ns records


see my edited files


Attached File(s)
.zip  custom_ns_record.zip (Size: 8.75 KB / Downloads: 12)
04-26-2010 01:37 AM
Find all posts by this user Quote this message in a reply
gOOvER Offline
Banned

Posts: 3,561
Joined: Jul 2007
Post: #7
RE: Custom DNS server
Can you Open à Ticket and add the Patch please?
04-26-2010 02:49 AM
Visit this user's website Find all posts by this user Quote this message in a reply
can79 Offline


Posts: 4
Joined: Apr 2010
Reputation: 0
Post: #8
RE: Custom DNS server
(04-26-2010 02:49 AM)gOOvER Wrote:  Can you Open à Ticket and add the Patch please?

I am a new user with ispCP.
I do not know how that works. (ticket & patch )

I am only testing.
but my first impression about ispCP, pretty fun hosting panel.
course with an advanced dns control, will be very nice hosting panel.
04-26-2010 09:26 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)