No announcement yet.

How to Assign Dedicated IP Addresses to Subdomains

  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Assign Dedicated IP Addresses to Subdomains


    This document describes how to manually assign a dedicated IP address to a user's subdomain. You can assign a dedicated IP address to a user's subdomain for either of the following reasons:

    1.The subdomain requires an SSL certificate.
    2.The subdomain hosts an anonymous FTP site.


    The following organizations' IP address usage policies all follow Requests For Comments (RFC) 2050:
    A.The Internet Corporation for Assigned Names and Numbers (ICANN).
    B.The Internet Assigned Numbers Authority (IANA).
    C.The Number Resources Organization (NRO).

    RFC 2050 states the following:

    ISPs are required to utilize address space in an efficient manner. To this end, ISPs should have documented justification available for each assignment. The regional registry may, at any time, ask for this information. If the information is not available, future allocations may be impacted. In extreme cases, existing loans may be impacted.

    Note:You can also use the procedure that this document describes to assign dedicated IP addresses to addon domains.

    Assign a dedicated IP address to a subdomain

    To assign a dedicated IP address to a subdomain, perform the following steps:

    Step 1: Add the dedicated IP address to the user's subdomain file.

    Note:In this example, represents the subdomain to which to assign a dedicated IP address.

    To add the dedicated IP address to the file, perform the following steps:

    1.Log in to the server as the root user via SSH.

    2.Navigate to the /var/cpanel/userdata/username directory.
    Note:username represents the user who requires that each subdomain use a dedicated IP address.

    3.Open the file with a text editor. The file's contents will resemble the following example:

    format: combined
    target: /usr/local/apache/domlogs/
    format: "\"%{%s}t %I .\\n%{%s}t %O .\""
    target: /usr/local/apache/domlogs/
    documentroot: /home/username/public_html
    group: Group1
    hascgi: 1
    homedir: /home/username
    owner: username
    phpopenbasedirprotect: 1
    port: 80
    path: /home/username/public_html/cgi-bin
    url: /cgi-bin/
    path: /home/username/public_html/cgi-bin/
    url: /cgi-bin/
    serveradmin: [email protected]
    serveralias: Example Domain
    usecanonicalname: 'Off'
    user: username
    userdirprotect: ''

    4.Change the ip line to reflect the dedicated IP address to assign to the subdomain, for example:


    Important:On servers that use the 1:1 NAT configuration, you must add the server's internal IP address to this file.

    Step 2: Rebuild and restart Apache

    After you modify the appropriate files, rebuild and restart Apache. To do this, perform either of the following actions:

    1.Manually rebuild and restart Apache. To do this, run the following commands:


    2.Rebuild and restart Apache in WHM's Restart Services interface (Home >> Services >> Restart Services).

    Step 3: Add the IP address to the nameserver records

    Add the subdomain's dedicated IP address to the server's nameserver records. To do this, use either of the following methods:

    1.Edit the subdomain's IP address in WHM's Edit DNS Zone interface (Home >> DNS Functions >> Edit DNS Zone).
    2.Edit the subdomain's IP address with the WHM API 1 Functions - editzonerecord function call.

    Step 4: Reserve the dedicated IP address

    To reserve the subdomain's dedicated IP address, Add the subdomains' dedicated IP address to the reserved IP list so that the system does not assign it other accounts or sites. Perform this action in WHM's Show/Edit Reserved IPs interface (Home >> IP Functions >> Show/Edit Reserved IPs).