Is there any issues to modifying the CNAME for cdn.abc.com to point to cloudfront.abc.com instead of the Cloudflare domain?
Is there way to altering the hosts file to test in windows environment .
Run a dig command on the hostname you want to test against and add the resulting IP address in your hosts file with the public hostname.
Related
I'm trying to set up my local web development environment to map all .test domains to 192.168.10.10 IP. The problem is that I find all the tutorials extremely confusing.
Here's what I did already:
I installed dnsmasq using Homebrew with brew install dnsmasq command.
I put address=/.test/192.168.10.10 to /usr/local/etc/dnsmasq.conf.
I'm not sure what to do with the resolver. I have an /etc/resolv.conf file containing nameserver 172.20.10.1 (I don't know where it comes from) and then some tutorials say to create /etc/resolver/test file and putting nameserver 127.0.0.1 there.
Here's where I'm lost. First of all, which resolver should I use? The resolv.conf file or /etc/resolver/test? If that's the latter one, should I edit out the resolv.conf? And also, should I put nameserver 127.0.0.1 or nameserver 192.168.10.10? I don't understand if that's supposed to be the IP of my local machine (127.0.0.1) or my web dev machine (192.168.10.10).
Please help me to understand it better.
So I'm using dnsmasq for my local dev environment & I need to set it up to use multiple domains ex. (.dev, .test, .somethingelse) how can this be done?
currently It's working with .dev only
this is how my dnsmasq.conf looks like
address=/dev/127.0.0.1
listen-address=127.0.0.1
For every (sub)domain you want to server locally, add the following entry to your dnsmasq.conf:
address=/.domain/127.0.0.1
Now let your OS know, that you want to redirect requests to this domain to your local dnsmasq nameserver. Do this by creating a file "domain" in "/etc/resolvers".
/etc/resolvers/domain has the following content:
nameserver 127.0.0.1
More info about the resolver thing.
A more generic answer would be to have in /etc/dnsmasq.conf
local=/mylan/
and in /etc/hosts
192.168.1.3 dev dev.mylan
192.168.1.3 test test.mylan
192.168.1.4 build build.mylan
as per https://serverfault.com/questions/136332/setting-up-dnsmasq-for-a-local-network
(note that the solution comes in aid for the DHCP settings where you cannot have 2 hosts on the same IP, as the OP liked)
for me, address=/.aaa.com/.bbb.com/127.0.0.1 do the trick.
.dev is not recommended to be used in development as Google actually owns that top level domain.
You might want to use reserved TLDs, like .localhost, for development.
Good article about the same problem: https://web.archive.org/web/20180722223228/https://iyware.com/dont-use-dev-for-development/
In your /usr/local/etc/dnsmasq.conf add:
address=/dev/test/127.0.0.1
And then create files:
/etc/resolver/dev and /etc/resolver/test. Both with content:
nameserver 127.0.0.1
From now all xyz.dev and xyz.test domains will point to 127.0.0.1.
i'm using wamp 5, windows XP. i have edited my host file in my local disk like the code below and it works
127.0.0.0 example.com
but i'd like to redirect to a particular folder, if i change it to the code below, it dont work
127.0.0.0/main/site example.com
how to redirect example.com to 127.0.0.0/main/site locally in my PC?
btw, i dont want to install any new software to solve this prob
You need to create a Virtual Hosts
Leave the HOST file as
127.0.0.1 example.com
When you define a Virtual Host you also tell it which folder is its DocumentRoot so that will send it to the right place when you use the address example.com in the browser.
Check out wampserver.com
How can i run local tests ( with mamp ) that have urls of this kind : www.example.com instead of http://localhost:8888/install.folder
Thank you
If your tests are truely local, you may simply add an alias in your hosts file (/etc/hosts on linux). This alias will cause your computer to resolve www.example.com as 127.0.0.1 (localhost).
If you wish to use this outside of your computer, you will need to purchase a domain, and set its DNS up to forward to your IP address (and open the appropriate port in your router to forward to your computer).
If you don't want to have to include the port number (':8888'), change the port that your server is being hosted on to the default (80). This may be done through the server's configuration file by changing the 'Listen' directive.
If you do not want to have to add the '/drupal' path, add an 'Alias' directive to redirect the user from the root path ('/') to '/drupal'. You may also change the 'DocumentRoot' to drupal.
You will need to add an entry to your hosts file like this:
127.0.0.1 www.example.com
Note: this will not keep you from having to enter the port number or directory - it will only allow you to use a host alias for the host name itself.
is it possible to somehow tell windows that when I try to access ip a.b.c.d it should access w.x.y.z ? Thanks
You could modify your hosts file. On WindowsXP it is located at
C:\WINDOWS\system32\drivers\etc
you will notice it has default routes setup already such as
127.0.0.1 localhost
you can then add your own route there
123.45.67.89 superduper