0

On my desktop I use /etc/hosts file like as below for developing purpose

127.0.0.1   a.example.com
127.0.0.1   www.a.example.com
127.0.0.1   adsense.a.example.com
127.0.0.1   foto.a.example.com

They all work except www.a.example.com it doesn't forward to localhost. Could you explain why? and any workaround?

I use Ubuntu 10.10. Thanks

JdeBP
  • 3,970
  • 17
  • 17
Gok Demir
  • 273
  • 1
  • 3
  • 14

2 Answers2

0

What do you mean with "They work"? Where? In a browser? On the console?

What is the output of

host www.a.example.com

or

dig www.a.example.com

on the console?

rems
  • 2,240
  • 13
  • 11
0

Some theories:

  1. The www.a.example.com record is seperated by tabs as opposes to spaces for the rest, or visa-versa. In theory, the host file should accept either tabs or spaces, but ubuntu might be picky.
  2. Something else in your host file is taking precedence over www.a.example.com. Is there an entry for *.a.example.com
  3. Does www.a.example.com contain any unicode characters? If you display it with cat, less or more on a terminal doe it look funny?
Justin Dearing
  • 1,017
  • 10
  • 33