Questions tagged [hosts]

/etc/hosts is the configuration file with locally known mappings between domain name and ip address.

/etc/hosts is the configuration file with locally known mappings between domain name and ip address. It can be used to define new or override existing mapping, bypassing the DNS that would normally resolve it.

271 questions
2
votes
1 answer

How do I setup a custom host in Linux Mint?

I want to redirect a host to local machine, in windows you get a hosts file. Is there something like this in Linux?
JL.
  • 1,283
  • 10
  • 22
  • 35
2
votes
1 answer

Possible to load entries into hosts.deny from text file?

I have around 96 million IP addresses that I have collected and routinely validate to be VPN providers, proxies, etc. I want these blocked. Currently, I am including the list formatted like deny ip; in nginx and that works perfectly. I want to…
Tar
  • 265
  • 4
  • 11
2
votes
3 answers

wget not working with domain on local machine

Basically - I have some PHP scripts that need to be run as cron jobs. Lets say the script needing to be run is: http://admin.somedomain.com/cron_jobs/get_stats If I run the script from the local machine it gives me a 404 Not Found error. So I…
user568829
  • 231
  • 1
  • 3
  • 8
2
votes
1 answer

Since when the linux host utility ignores /etc/hosts?

I was struggling trying to find out the reason why the linux host utility was ignoring my /etc/hosts file until I find the answer to my question here: hosts file seems to be ignored: With this configuration, most applications will happily work…
Luis Fernando Alen
  • 540
  • 1
  • 5
  • 11
2
votes
1 answer

Mapping all subdomains of a domain to an IP

How should I set up a server to map all subdomains of a domain to an IP? I wish I could do something like that in the hosts file: 127.0.0.1 *.example.com
Emanuil Rusev
  • 901
  • 3
  • 10
  • 16
2
votes
1 answer

Editing hosts file - will removing default settings cause trouble?

I'm running a CentOS 5.4 machine and had trouble getting sendmail to work. After a bunch of researching, I found out that I needed to change my servers FQDN. /etc/hosts had the following: 127.0.0.1 localhost localhost.localdomain xx.xx.xx.xx…
Arms
  • 123
  • 4
2
votes
1 answer

Getting "unknown host" on hostname despite adding it to /etc/hosts

I have an Ubuntu server called crow: $ hostname crow But when I try to ping it (from itself), I get unknown host: $ ping crow ping: unknown host crow This is despite explicitly adding crow to /etc/hosts: $ sudo cat /etc/hosts 127.0.0.1 …
sanity
  • 739
  • 3
  • 9
  • 16
2
votes
2 answers

Linux: hosts.allow, hosts.deny - how do I allow all except hosts mentioned in hosts.deny

How do I configure hosts.allow and hosts.deny to allow all connections from all hosts except for some hosts/ports specified in hosts.deny? This is what I have now in these files: hosts.allow: ALL:ALL hosts.deny: somehost:someport I want to allow…
user58292
2
votes
1 answer

Why can't I access an administrative share on my local machine?

I'm working on a Windows Server 2008 R2 (x64) VirtualBox image that I've set up as a CI/deployment testing environment. I've got VirtualBox set to use Internal-Only networking. I've set up hosts file redirects for the names of my production…
Matt Mills
  • 283
  • 1
  • 3
  • 10
2
votes
1 answer

Make an ip based virtual host only respond to a single host name

Is it possible to make an apache ip based virutal host only respond to a specific host name? I have a rouge domain name pointing to my server. I know I could redirect it or throw up a 401, but would just rather the server not even respond to a…
Bob
2
votes
2 answers

How to get the same result as modifying /etc/hosts file, without root access?

The question is simple: no root access, but need to point particular domain name to the specified IP address. What are the other ways to do the same thing as with adding the record to /etc/hosts file? UPDATE: Clarification: My domain had been…
Andrejs Cainikovs
  • 1,621
  • 1
  • 14
  • 20
1
vote
2 answers

What to use for a hostname on a dedicated Linux server?

I've recently run into Debian wiki not recommending to set exim's primary_hostname explicitly. From what I can gather, here's the code that chooses primary_hostname. Basically, either I have FQDN in /etc/hostname (myhostname.example.com), or just…
x-yuri
  • 2,141
  • 2
  • 24
  • 29
1
vote
1 answer

Can ping NAS by ip and hostname in Windows 10 console, but not find by ip or hostname in Windows explorer

I have set up a new PC with Windows 10. Now I want to access two local NAS drives but can't connect to them. With my old PC and all coworkers pcs everything is fine. There is no special access restriction. I also can't see them in the network…
Askger
  • 11
  • 1
  • 2
1
vote
1 answer

DNS Resolution Sequence in Digital Ocean Droplets

I have setup multiple domains on my droplet and they cross-reference each other. Currently, when I do a nslookup for these domains from within the droplet, the DNS resolution is handled by 67.207.67.3 which is Digital Ocean's DNS server and it…
Mangesh
  • 13
  • 3
1
vote
1 answer

Problems installing Ruby gem on Gandi VPS Debian 9 server

I have a Gandi Debian 9 server that I use for web page hosting. I am trying to install a Ruby gem on the system but it looks like I am either being blocked from installing gems or I need to setup my system to install gems. This is what I've done to…
Dodzi Dzakuma
  • 169
  • 2
  • 8