banner



How To Change Domain Name In Kali Linux

Kali Linux is becoming popular and more and more users are using it to try out different things. When installing kali, you get to cull a hostname, but in case y'all accustomed the default hostname (kali) and later want to modify it, here'due south a How to guide to modify hostname in Kali Linux.

Now but changing hostname to something else might not exist enough. How virtually we change hostname every time you kicking your computer to a random one? That could be fun. It likewise helps to avoid suspicion from System Admins in your network to encounter "kali" in their network. Like BackTrack, SysAdmins doesn't like Kali much (I mean why would they? Kali is designed to poke and prod effectually the network to find vulnerability). Even if you're using Kali as your primary Bone, it only raises eyebrows and yous might get a visit from an over-witting SysAdmin. So we will discuss all possible means, change hostname to something else permanently and change hostname randomly in each kick.

  1. Change hostname permanently and go far glutinous – with reboot
  2. Alter hostname permanently and brand information technology viscid  – without rebooting
  3. Change hostname randomly in each boot time.

Change hostname permanently – with reboot

As always, I've divided the options into multiple dot points.

Footstep i: edit hostname file

Open hostname file from /etc directory and modify the name in there.

leafpad /etc/hostname

How to change hostname in Kali Linux - 1- blackMORE Ops

Permit's say nosotros change the name from kali to aiur

How to change hostname in Kali Linux - 2- blackMORE Ops

Save the file.

Step ii: edit hosts file

Open up hosts file from /etc directory and modify the name in there.

leafpad /etc/hosts

How to change hostname in Kali Linux - 3 - blackMORE Ops

Change kali to aiur.

How to change hostname in Kali Linux - 4 - blackMORE Ops

Salvage the file.

Pace iii: reboot

Now reboot to reflect your changes

reboot

And you should encounter the new hostname coming up in concluding (i.e. root@aiur)

How to change hostname in Kali Linux - 6 - blackMORE Ops

Modify hostname permanently – without reboot

Don't want to reboot?  Here's how

Follow step 1 and 2 from in a higher place

i.e.

  1. Update /etc/hostname
  2. Update /etc/hosts, so local address (es) resolves with the new arrangement name.

Reload configuration files

Type in post-obit 3 commands one at a time.

service hostname.sh starting time service networking force-reload service network-manager force-reload

How to change hostname in Kali Linux - 7 - blackMORE Ops

At present strength-reload networking service.

How to change hostname in Kali Linux - 8 - blackMORE Ops

This volition temporarily disconnect your system from the network (ssh commonly resists short disconnection)

This might definitively disconnect your system from the network because networking might not restore connections; delight reboot, which is non lazy, but ensures that your setup is really right

How to change hostname in Kali Linux - 9 - blackMORE Ops

So we need to reload network-manager service as well.

How to change hostname in Kali Linux - 10 - blackMORE Ops

This should reconnect networking again.

How to change hostname in Kali Linux - 11 - blackMORE Ops

Depending on what other services you lot're running, i.e. avahi, metasploit, postgresql, cups, openSSH server, ssmtp etc. you might have to restart them all.

Now y'all must close your existing terminals to have the new hostname coming up at the acme. See following screenshot with highlighting.

First screenshot is after re-loading all the required services. Notation that it'due south still showing root@kali in the superlative. uname -a or hostname shows correct info though.

How to change hostname in Kali Linux - 12 - blackMORE Ops

If I close this terminal and open a new one, root@kali becomes root@aiur which is what nosotros desire.

How to change hostname in Kali Linux - 13 - blackMORE Ops

Modify hostname randomly in each kick fourth dimension

Post-obit process will permit you to change your hostname randomly in each boot. That hostname will stick until y'all reboot again.

Create a fustigate script

Create a script which will automate the procedure

In this terminal create a file.

bear upon newhostname leafpad newhostname

How to change hostname in Kali Linux - 14 - blackMORE Ops

Now, add the following lines to your newly created file:

#!/bin/bash cp -n /etc/hosts{,.erstwhile} idomainname=$(domainname -i) fdomainname=$(domainname -f) newhn=$(cat /dev/urandom | tr -dc 'A-Z' | head -c8) echo $newhn > /etc/hostname mv /etc/hosts /etc/hosts.quondam echo "127.0.0.1 localhost" > /etc/hosts echo "$idomainname  $fdomainname    $newhn" >> /etc/hosts echo "# The post-obit lines are desirable for IPv6 capable hosts" >> /etc/hosts echo "::one     localhost ip6-localhost ip6-loopback" >> /etc/hosts echo "ff02::ane ip6-allnodes" >> /etc/hosts repeat "ff02::ii ip6-allrouters" >> /etc/hosts service hostname.sh cease sleep 1 service hostname.sh start service networking stop sleep i service networking start service network-manager terminate sleep one service network-manager first xhost +$newhn go out

Save it and exit leafpad.

Note: I've used only CAPS here for new hostname, 'A-Z'. You lot tin also choose a mixure of capital letter and lowercase ('A-Za-z') or numbers etc.

Also I've chosen viii characters long hostname head -c8, you tin modify it to any length you like.

Move script to /usr/bin/ folder

We need to move this file to /usr/bin.

mv newhostname /usr/bin/newhostname

Brand it executable

Use the following command to make newhostname file executable.

chmod +x /usr/bin/newhostname

How to change hostname in Kali Linux - 16 - blackMORE Ops

Brand information technology run at Startup:

At present that nosotros accept the script in right identify and information technology'southward executable, we need to add together it your Startup applications. This will let your arrangement to run information technology every time you reboot your machine and generate a new hostname for y'all.
Follow the steps beneath:

  1. Click on "Applications" –> "System Tools" –> "Preferences" –> "Startup Applications"
  2. Click "Add"
  3. Fill in:
    1. Name: Random Host Name
    2. Command: /usr/bin/newhostname
    3. Comment: Start Kali with a random hostname each boot
  4. Click Save
  5. Close Windows

How to change hostname in Kali Linux - 17 - blackMORE Ops

How to change hostname in Kali Linux - 18 - blackMORE Ops

How to change hostname in Kali Linux - 19 - blackMORE Ops

Reboot

Finally reboot your machine to load the script at start-up.

reboot

How to change hostname in Kali Linux - 5 - blackMORE Ops

Bask your new hostnames. Here's mine

How to change hostname in Kali Linux - 20 - blackMORE Ops

Credits and sources:

Similar procedures were posted in different places:

  1. Telecomix Wiki
  2. Ubuntu Forums by rocksockdoc
  3. Kali forums by testingresults, ,
  4. Notesbit past Jiltin

Thank you for reading. Please share with others.

How To Change Domain Name In Kali Linux,

Source: https://www.blackmoreops.com/2013/12/12/change-hostname-kali-linux/

Posted by: smithprame1944.blogspot.com

0 Response to "How To Change Domain Name In Kali Linux"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel