You are not logged in.
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 mycomp.appsnet.net localhost
::1 mycomp.appsnet.net localhost
192.168.1.101 mycomp.appsnet.net mycomp
# End of file
Would this cause concern?
XFCE4
DHCP
Not using NetworkManger
Desktop
My static assigned ROUTER ip is 192.168.1.101
My registered domain is appsnet.net
Or is this better? What are the differences?
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost mycomp
::1 localhost.localdomain localhost mycomp
192.168.1.101 mycomp.appsnet.net mycomp
# End of file
Offline
127.0.0.1 localhost.localdomain localhost mycomp
::1 localhost.localdomain localhost mycomp
I don't have my own domain so I dunno about the 3rd line.
Last edited by graysky (2010-12-16 05:55:51)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
::1 mycomp.appsnet.net localhost
what is this for?
Last edited by masteryod (2010-12-16 17:54:17)
Offline
::1 mycomp.appsnet.net localhost
what is this for?
ipv6
Offline
Oh my gosh! That was the quickest answer ever!
Last edited by masteryod (2010-12-16 18:05:39)
Offline
So, which example above (in my original post) is correct? Are they both correct? What is the best way to do this?
Offline
The second looks almost fine. You could add another alias, though (https://bbs.archlinux.org/viewtopic.php?id=36909):
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 arch.domain.edu localhost.localdomain localhost arch
xxx.xx.xxx.xx arch.domain.edu arch
# End of file
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
A bit OT but usefull. While you're at it, why don't you add some additional stuff to your hosts-file to keep certain stuff at bay? Trackers and the like...
More info at:
Hosts-File from mvps
Ad-blocking hosts-file from yoyo.org
Merge those two files together and add it to your hosts file.
cheers
Offline
A bit OT but usefull. While you're at it, why don't you add some additional stuff to your hosts-file to keep certain stuff at bay? Trackers and the like...
More info at:
Hosts-File from mvps
Ad-blocking hosts-file from yoyo.orgMerge those two files together and add it to your hosts file.
cheers
Here's a little script that does just that, based on one done by Wintervenom.
Copy existing /etc/hosts to /etc/hosts.local, and this script will merge the two blacklists, sort and delete duplicates, and output to /tmp/hosts. Change OUTPUTFILE to /etc/hosts if you want to run this script as root and not have to copy over the new hosts file.
#!/bin/bash
#
# Credit to Scott Garrett (Wintervenom) for the basis of this script
#
# set output file
OUTPUTFILE=/tmp/hosts
# make temporary directory
TMPDIR=/tmp/hostsupdatescript
mkdir -p "${TMPDIR}"
# download the mvps.org hosts file.
wget -c -O "${TMPDIR}/hosts.mvps" http://www.mvps.org/winhelp2002/hosts.txt
# find relevant lines without comments
grep ^127.0.0.1 "${TMPDIR}/hosts.mvps" > "${TMPDIR}/hosts.mvps.new1"
# 0.0.0.0 is nicer than constantly knocking on localhosts' door.
sed -e 's/127.0.0.1 /0.0.0.0 /g' "${TMPDIR}/hosts.mvps.new1" > "${TMPDIR}/hosts.mvps.new2"
# remove inline comments
cut -d' ' -f -2 "${TMPDIR}/hosts.mvps.new2" > "${TMPDIR}/hosts.mvps.new3"
# remove carriage returns
cat "${TMPDIR}/hosts.mvps.new3" | tr -d "\r" > "${TMPDIR}/hosts.mvps.final"
# download the pgl.yoyo.org hosts file
wget -c -O "${TMPDIR}/hosts.yoyo" "http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext"
# find relevant lines without comments
grep ^127.0.0.1 "${TMPDIR}/hosts.yoyo" > "${TMPDIR}/hosts.yoyo.new1"
# 0.0.0.0 is nicer than constantly knocking on localhosts' door.
sed -e 's/127.0.0.1/0.0.0.0/g' "${TMPDIR}/hosts.yoyo.new1" > "${TMPDIR}/hosts.yoyo.final"
# sort blocklist entries and remove duplicates
cat "${TMPDIR}/hosts.mvps.final" > "${TMPDIR}/hosts"
cat "${TMPDIR}/hosts.yoyo.final" >> "${TMPDIR}/hosts"
sort "${TMPDIR}/hosts" | uniq > "${TMPDIR}/hosts.final"
# write the user's hosts.local to head, then the blacklists
cat /etc/hosts.local > "${OUTPUTFILE}"
echo -e "\n# blocklist from mvps.org and pgl.yoyo.org" >> "${OUTPUTFILE}"
cat "${TMPDIR}/hosts.final" >> "${OUTPUTFILE}"
# delete temporary directory
rm -rf "${TMPDIR}
edit: typo
Last edited by dyscoria (2010-12-17 09:40:05)
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
That wintervenom's script is just beautiful..
I use an extended /etc/hosts to harden opera, and this merging seems fine. One question though:
the mvps one gets the 127.0.0.1 and the yoyo one gets the 0.0.0.0.
Someone knows the reason for that??
sed -e 's/127.0.0.1 /0.0.0.0 /g'
sed -e 's/127.0.0.1/0.0.0.0/g'
Maybe the reason? I'm no script-kiddie...
Last edited by jocheem67 (2010-12-17 09:54:42)
Offline
That wintervenom's script is just beautiful..
I use an extended /etc/hosts to harden opera, and this merging seems fine. One question though:the mvps one gets the 127.0.0.1 and the yoyo one gets the 0.0.0.0.
Someone knows the reason for that??
sed -e 's/127.0.0.1 /0.0.0.0 /g'
sed -e 's/127.0.0.1/0.0.0.0/g'
Maybe the reason? I'm no script-kiddie...
I changed the sed lines because the mvps blocklist has two spaces after 127.0.0.1 whereas the yoyo blocklist only has one space. If we leave it like it is, the duplicate lines (which are not actually duplicates because of the extra space) won't be removed.
Last edited by dyscoria (2010-12-17 10:03:51)
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
A bit OT but usefull. While you're at it, why don't you add some additional stuff to your hosts-file to keep certain stuff at bay? Trackers and the like...
More info at:
Hosts-File from mvps
Ad-blocking hosts-file from yoyo.orgMerge those two files together and add it to your hosts file.
cheers
That is the ugliest thing I saw... Dynamic blocking with a FF plugin is much more elegant IMHO. /etc/hosts is a system-wide config file and must not be touched whenever a user encounteres a malicious web site.
Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd
Offline
itman wrote:A bit OT but usefull. While you're at it, why don't you add some additional stuff to your hosts-file to keep certain stuff at bay? Trackers and the like...
More info at:
Hosts-File from mvps
Ad-blocking hosts-file from yoyo.orgMerge those two files together and add it to your hosts file.
cheers
That is the ugliest thing I saw... Dynamic blocking with a FF plugin is much more elegant IMHO. /etc/hosts is a system-wide config file and must not be touched whenever a user encounteres a malicious web site.
I actually think it's an effective way of blocking web sites. It is browser independent and free from false positives.
Granted Adblock Plus provides some further flexibility and functions, but I have a bias against third-party extensions
flack 2.0.6: menu-driven BASH script to easily tag FLAC files (AUR)
knock-once 1.2: BASH script to easily create/send one-time sequences for knockd (forum/AUR)
Offline
@Leonid.I that might be true for FF but what about the other browsers?
@dyscoria thanks for diggin out that script. Very usefull indeed.
hu - when running that script it throws:
./yoyo-mvps-hostsfile: Zeile 42: Dateiende beim Suchen nach `"' erreicht.
./yoyo-mvps-hostsfile: Zeile 44: Syntax Fehler: Unerwartetes Dateiende.
at me. The "/tmp/hosts" does get created and it seems ok to me....
cheers
Last edited by itman (2010-12-26 14:34:53)
Offline