Giter Site home page Giter Site logo

hjacobs / local-cname Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 11.0 21 KB

Helper script to emulate a local CNAME DNS by writing to /etc/hosts

Home Page: https://pypi.org/project/local-cname/

License: GNU General Public License v3.0

Python 100.00%
cname hostsfile hosts dns

local-cname's Introduction

local-cname's People

Contributors

hjacobs avatar neki avatar nunofernandes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

local-cname's Issues

Exception occurred: getaddrinfo() takes no keyword arguments

I installed local-cname on a new Ubuntu 18.04 VM. First I installed Python on it with "sudo apt-get install python-pip" and then local-cname with "sudo pip install -U local-cname". When I tried "sudo local-cname google.com duckduckgo.com" I received the following: "ImportError: No module named pathlib". I then installed pathlib with "sudo pip install pathlib".
Now when I try "sudo local-cname google.com duckduckgo.com" I receive this: "Resolving duckduckgo.com .. EXCEPTION OCCURRED: getaddrinfo() takes no keyword arguments". Please see the screenshot attached.
local_cname_issue

Error running inside docker

Hi.. I'm getting the following error when running inside docker when I stop the service.

OSError: [Errno 16] Device or resource busy: '/etc/hosts.local-cname-backup' -> '/etc/hosts'

/etc/hosts is mounted by the docker daemon so the rename will fail.

# mount | grep hosts
/dev/nvme0n1p1 on /etc/hosts type xfs (rw,relatime,seclabel,attr2,inode64,noquota)

A good way of fixing could be something like detecting if /etc/hosts is mounted and if do, just do something like a cat over the file (like the pseudo code):

cat /etc/hosts.local-cname-backup > /etc/hosts
rm  /etc/hosts.local-cname-backup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.