Tuesday, November 28, 2023
LetsAskBinu.com
  • Home
  • Cybersecurity
  • Cyber Threats
  • Hacking
  • Protection
  • Networking
  • Malware
  • Fintech
  • Internet Of Things
No Result
View All Result
LetsAskBinu.com
No Result
View All Result
Home Networking

How to Edit the Linux Hosts File

Researcher by Researcher
July 12, 2023
in Networking
0
How to Edit the Linux Hosts File
189
SHARES
1.5k
VIEWS
Share on FacebookShare on Twitter


In this step-by-step guide from Jack Wallen, learn how to access and modify the Linux hosts file to control the mapping of hostnames to IP addresses.

At some point in your career as a developer, you’re going to have to map an IP address to a hostname in Linux – this might happen when you’re deploying a Kubernetes cluster or a Docker Swarm. Or maybe you want to make it easier for you to point a web browser to an internal site or service.

Instead of typing 192.168.1.11, you could type the hostname you’ve mapped in /etc/hosts. Although this is a pretty basic idea, it’s one that you’ll use quite a bit as an admin or a developer. Let me show you how it’s done. Note: You’ll need a running instance of Linux and a user with sudo privileges.

Related articles

Microsoft Improves Windows Security with a Path to Move Off NTLM

Microsoft Improves Windows Security with a Path to Move Off NTLM

November 22, 2023
New Solutions Offer More Security and Productivity from Windows in the Cloud

New Solutions Offer More Security and Productivity from Windows in the Cloud

November 16, 2023

The first thing you’ll do is log into Linux and then open the necessary file for editing with the command sudo nano /etc/hosts. When prompted, type your sudo password.

You’ll already see a few entries in place. The two at the top are for IPv4 addresses that map the loopback address to localhost and your hostname; the entries below that are the same but for IPv6. At the bottom of the file is where you’ll add new entries.

Let’s add an entry that maps IP address 192.168.1.11 to the invoiceplane name. That entry will look like 192.168.1.11 invoiceplane. What we’ve done is mapped the IP address to a hostname. You can also add a fully qualified domain name after the hostname such as 192.168.1.11 invoiceplane invoiceplane.monkeypantz.lan or whatever FQDN you need. Save and close the file.

You can verify it’s working by issuing the command ping invoiceplane, which should ping the address 192.168.1.11. You can even use the nickname mapped in /etc/hosts in your web browser by pointing it to http://invoiceplane or, in my case, http://invoiceplane/invoiceplane.

And that’s all there is to editing the Linux hosts file and mapping IP addresses to names that wouldn’t otherwise have been visible via regular DNS.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.



Source link

Tags: EditFileHostsLinux
Share76Tweet47

Related Posts

Microsoft Improves Windows Security with a Path to Move Off NTLM

Microsoft Improves Windows Security with a Path to Move Off NTLM

November 22, 2023
0

NTLM is a simple and straightforward authentication method for connecting to applications on enterprise servers, but it’s also outdated and...

New Solutions Offer More Security and Productivity from Windows in the Cloud

New Solutions Offer More Security and Productivity from Windows in the Cloud

November 16, 2023
0

During Microsoft Ignite, the company announced various ways in which users will be able to get more security and productivity...

NVIDIA High-Performance Chips Power AI Workloads

NVIDIA High-Performance Chips Power AI Workloads

November 15, 2023
0

NVIDIA’s AI Enterprise software shown at Supercomputing ‘23 connects accelerated computing to large language model use cases. At the Supercomputing...

UK Leads Europe in IT Automation, But Key Challenges Persist

UK Leads Europe in IT Automation, But Key Challenges Persist

November 14, 2023
0

The U.K.'s position as a financial services hub puts it ahead in enterprise-wide IT automation, says Red Hat. But skills...

Threat Actors Use Known Excel Vulnerability

Sandworm, a Russian Threat Actor, Disrupted Power in Ukraine Via Cyberattack

November 13, 2023
0

Any company that is strategic could be targeted for the same kind of actions as this cyberattack. Follow these tips...

Load More
  • Trending
  • Comments
  • Latest
This Week in Fintech: TFT Bi-Weekly News Roundup 08/02

This Week in Fintech: TFT Bi-Weekly News Roundup 15/03

March 15, 2022
Supply chain efficiency starts with securing port operations

Supply chain efficiency starts with securing port operations

March 15, 2022
Microsoft to Block Macros by Default in Office Apps

Qakbot Email Thread Hijacking Attacks Drop Multiple Payloads

March 15, 2022
QNAP Escalation Vulnerability Let Attackers Gain Administrator Privileges

QNAP Escalation Vulnerability Let Attackers Gain Administrator Privileges

March 15, 2022
Beware! Facebook accounts being hijacked via Messenger prize phishing chats

Beware! Facebook accounts being hijacked via Messenger prize phishing chats

0
Shoulder surfing: Watch out for eagle‑eyed snoopers peeking at your phone

Shoulder surfing: Watch out for eagle‑eyed snoopers peeking at your phone

0
Remote work causing security issues for system and IT administrators

Remote work causing security issues for system and IT administrators

0
Elementor WordPress plugin has a gaping security hole – update now – Naked Security

Elementor WordPress plugin has a gaping security hole – update now – Naked Security

0
North Korean Hackers Exploiting Zero-day Vulnerabilities

North Korean Hackers Exploiting Zero-day Vulnerabilities

November 28, 2023
North Korean Hackers Exploit MagicLine4NX Zero-day

North Korean Hackers Exploit MagicLine4NX Zero-day

November 28, 2023
NukeSped Malware Exploiting Apache ActiveMQ Vulnerability

NukeSped Malware Exploiting Apache ActiveMQ Vulnerability

November 28, 2023
A New Telekopye Bots That Tricks Users to Steal Payment Details

A New Telekopye Bots That Tricks Users to Steal Payment Details

November 27, 2023

Recent Posts

North Korean Hackers Exploiting Zero-day Vulnerabilities

North Korean Hackers Exploiting Zero-day Vulnerabilities

November 28, 2023
North Korean Hackers Exploit MagicLine4NX Zero-day

North Korean Hackers Exploit MagicLine4NX Zero-day

November 28, 2023
NukeSped Malware Exploiting Apache ActiveMQ Vulnerability

NukeSped Malware Exploiting Apache ActiveMQ Vulnerability

November 28, 2023

Categories

  • Cyber Threats
  • Cybersecurity
  • Fintech
  • Hacking
  • Internet Of Things
  • LetsAskBinuBlogs
  • Malware
  • Networking
  • Protection

Tags

Access attack Attacks banking BiWeekly bug Cisco cloud code critical Cyber Cybersecurity Data Digital exploited financial Fintech Flaw flaws Google Group Hackers Krebs Latest launches malware Microsoft million Network News open patches platform Ransomware RoundUp security Software Stories TFT Threat Top vulnerabilities vulnerability warns Week

© 2022 Lets Ask Binu All Rights Reserved

No Result
View All Result
  • Home
  • Cybersecurity
  • Cyber Threats
  • Hacking
  • Protection
  • Networking
  • Malware
  • Fintech
  • Internet Of Things

© 2022 Lets Ask Binu All Rights Reserved