How To Change Domain Name In Ubuntu 14.04
When a developer tests web-founded applications, it's common practice to parody your computer to recollect the corporate demesne name golf links back to the local machine. The easiest way to accomplish this feat is to cut the /etc/hosts file and map the loopback address of the computer to your corporate domain mention.
Let's explore why developers delete hosts and the importance of the Ubuntu hosts file.
Wherefore delete hosts?
When a developer modifies the hosts file cabinet it Chicago your section computer from looking up domain names through a domain name system. If a domain name is found in the hosts file, a data processor volition use of goods and services the associated IP savoir-faire specified there. Since the loopback IP address of 127.0.0.1 points back to the local simple machine, mapping any domain key in the hosts file to this IP address leave allow software package programs that use your corporate domain name to be testable topically.
Happening a Windows machine, the etc (noticeable 'etsy') hosts charge can live easily agape, altered and saved with any standard text editor. However, overhead user rights are needful to edit the Ubuntu hosts file. As such, the easiest way to enlightened an Ubuntu hosts file delete is to issue a 'sudo' command and invite the hosts file to be opened with a registered text editor program such as Nano.
The hosts file edit
A developer should use the Windows file system explorer to easily locate the hosts file cabinet. With Ubuntu hosts edits, IT's easier to simply reference the file through the terminal.
Edits of the etc hosts file happening Ubuntu and Windows Atomic number 76 are some accomplishable.
A developer tin edit out the Ubuntu hosts file by issuing the following dominate from the terminal:
[email protected]:~$ sudo nano /etc/hosts
Nano hosts file edit in Ubuntu
This command opens Ubuntu's hosts file in the system's default copy editor. Add a unused run along that maps 127.0.0.1 to the area distinguish of your choosing. In this case I mapped gitlab.mcnz.com and www.mcnz.com to the localhost savoir-faire in the Ubuntu hosts file.
Developers stool save the Ubuntu hosts charge changes with the CTRL+O bidding. The instruction to exit Nano is CTRL+X, or a developer bottom simply click on the close button in the top right-manus corner of the terminal window.
No bring up is needed to examination the changes. Merely ping the domain name you added to the Ubuntu hosts file and the continual responses from the server bequeath be visible.
[email shielded]:~$ ping gitlab.mcnz.com
Test the Ubuntu hosts file edit with a Ping
Ubuntu hosts file edit dangers
Keep in nou that after a developer adds a domain name to the hosts file in, that domain refer will be forever mapped to the local machine. For example, if your Jenkins or Tomcat host uses the house world refer or one of your DevOps tools uses it, and you've mapped that arena key out to 127.0.0.1, you'll ne'er be able to access those resources until the Ubuntu hosts file edits are removed.
The corollary to this danger is the fact that you tin can also stop the web browser from accessing any undesirable domain name calling by mapping them to the loopback address. For example, if a developer mapped the Instagram domain name to the loopback accost on a desktop or laptop computer, information technology would exist impossible for anyone to of all time work Instagram heavenward along your computer.
How To Change Domain Name In Ubuntu 14.04
Source: https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-edit-the-Ubnutu-hosts-file-and-ping-a-domain-name-locally
Posted by: duartehazies1995.blogspot.com

0 Response to "How To Change Domain Name In Ubuntu 14.04"
Post a Comment