0

I cannot post the following in forum, but I can here. It's happened many times and it's a bit annoying to be honest, it says the code I posted is wrong, there is no code here, but it also does it when I try to comment some things.

http://textuploader.com/aowvp

3
Contributors
5
Replies
20
Views
2 Years
Discussion Span
Last Post by Suzie999
0

The error.

The code snippet in your post is formatted incorrectly. Please use the Code button in the editor toolbar when posting whitespace-sensitive text or curly braces.

Edited by Suzie999

1

A hosts file should only have one redirect IP on each line, but I've seen some people put two like so...

127.0.0.1 somedomain.com aliasname   92.103.3.45 domain.org 

It would need to be fixed to look like so...

127.0.0.1 somedomain.com aliasname
92.103.3.45 domain.org

So here is an example of one I seen recently...

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost


127.0.0.1 localhost me
127.0.0.1 www.affiliatewindow.com/

127.0.0.1     activate.adobe.com     #adobe phone home fro dreamweaver

127.0.0.1     static.eplayer.performgroup.co.uk  perf
127.0.0.1     eplayer.performgroup.com  127.0.0.1     bactivate.adobe.com
127.0.0.1     www.performgroup.com      
# 127.0.0.1     www.javascript.com
# 127.0.0.1   www.yahoo.com

After it is parsed I would want it to look like this...

127.0.0.1     localhost me
127.0.0.1     www.affiliatewindow.com
127.0.0.1     activate.adobe.com
127.0.0.1     static.eplayer.performgroup.co.uk  perf
127.0.0.1     eplayer.performgroup.com
127.0.0.1     bactivate.adobe.com
127.0.0.1     www.performgroup.com

Only one IP per line
Can have multiple aliases after domain
No trailing whitespace
Comments removed
Slashes removed
Neat and tidy

Worked for me. Copied, pasted, select all, then pressed tab. (or perhaps it depends on the forum.) What forum did you post in?

Edited by pritaeas

Votes + Comments
Thank you kndly
0
A hosts file should only have one redirect IP on each line, but I've seen some people put two like so...

127.0.0.1 somedomain.com aliasname   92.103.3.45 domain.org 

It would need to be fixed to look like so...

127.0.0.1 somedomain.com aliasname
92.103.3.45 domain.org

So here is an example of one I seen recently...

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost


127.0.0.1 localhost me
127.0.0.1 www.affiliatewindow.com/

127.0.0.1     activate.adobe.com     #adobe phone home fro dreamweaver

127.0.0.1     static.eplayer.performgroup.co.uk  perf
127.0.0.1     eplayer.performgroup.com  127.0.0.1     bactivate.adobe.com
127.0.0.1     www.performgroup.com      
# 127.0.0.1     www.javascript.com
# 127.0.0.1   www.yahoo.com

After it is parsed I would want it to look like this...


127.0.0.1     localhost me
127.0.0.1     www.affiliatewindow.com
127.0.0.1     activate.adobe.com
127.0.0.1     static.eplayer.performgroup.co.uk  perf
127.0.0.1     eplayer.performgroup.com
127.0.0.1     bactivate.adobe.com
127.0.0.1     www.performgroup.com

Only one IP per line
Can have multiple aliases after domain
No trailing whitespace
Comments removed
Slashes removed
Neat and tidy
0

@pritaeas I never knew about pressing TAB, thanks.
That's what it looks like when I do that.

@rproffitt, I'm not so sure about that, the article does not mention hosts file, and I'd be a little wary of using 0.0.0.0 in it as I have Sockets listening on any connection, so if data gets redirected to it, I'd be afraid those sockets might pick it up.

Edited by Suzie999

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.